Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Upgrade target framework from NET Standard 2.0 to .NET 6.0 #393

Merged
merged 33 commits into from
Dec 19, 2024

Conversation

YBTopaz8
Copy link
Member

@YBTopaz8 YBTopaz8 commented Dec 5, 2024

Introduction

Hello Parse Community for .NET,

I am thrilled to submit this PR that helps modernize the Parse SDK for .NET by:

  1. Upgrading it to .NET 9 and MAUI, making it compatible with the latest features and patterns.
  2. Introducing Live Queries support for real-time functionality, fully rebuilt for .NET 9 and integrated with .NET MAUI for cross-platform development.

This contribution is a response to one of the most requested features in Parse for .NET: Live Queries. By bridging this gap, I believe Parse can now fully serve the modern .NET ecosystem and attract new developers who seek real-time functionality with minimal complexity and even shine some more light on the Goodies that .NET MAUI offer with this!


Acknowledging Prior Work

Before diving into the specifics, I want to recognize the existing PR feat: Fully support .NET Standard on various platforms.

While this PR doesn’t mention .NET MAUI or Live Queries, it lays the groundwork for compatibility across multiple platforms. I see it as a valuable stepping stone toward modernizing the Parse SDK. My work builds on the same ethos of broadening Parse’s reach while addressing critical developer needs like real-time updates and cross-platform stability.


Why did I finally do this PR?

1. Live Queries for .NET - Finally!

Live Queries have been a critical feature in Parse’s ecosystem, enabling real-time updates to clients. However, .NET developers have been left out of this functionality due to outdated implementations and a lack of modern support (Understandably so; It's no small feat!).

This PR:

  • Completely open doors for Live Queries support on ANY .NET platforms in Rebuilds Live Queries for .NET 9

2. Parse SDK for .NET 9 and .NET MAUI

.NET MAUI is the future of cross-platform development as per Microsoft, allowing developers to target Android, iOS, Windows, and macOS with a single codebase. Yet, Parse lacked compatibility with this framework—until now at least as I can happily report it working on MAUI devices as low as API 30 (Will test further if need be).

This PR:

  • Upgrades the Parse SDK to .NET 9, modernizing its async patterns, error handling, and overall architecture.
  • Resolves critical crashes related to HostManifestData that previously made MAUI integration unstable.
  • Hopes to maintain Parse as a first-class citizen in the .NET ecosystem, empowering developers to build cross-platform and now realtime apps with Parse as their backend.
  • Did some (I think most TODOs) in the codes and tested modern approaches (if the previously commented Idea was valid for its time but no longer now, I simply did a "Modern" implementation)

I had this ready for a while but wasn't done testing in my "ways" (you will understand just below) so now that I'm very happy and confident of the outcome, I am happily sharing.

(Somewhat) Technical Contributions (The codes might speak better than my words)

This PR makes several key improvements to the SDK and Live Queries:

SDK Enhancements

  1. Async Modernization:

    • Replaced legacy async patterns (.Unwrap(), .OnSuccess()) with async/await, improving readability, performance, and maintainability.
    • Updated control flows to align with modern .NET best practices.
  2. Error Handling Improvements:

    • Errors now return detailed error objects instead of throwing vague exceptions. This improves debugging and provides actionable insights during development.
    • Handled several internal bugs, like the one responsible for getting response.length() ALWAYS throwing an exception because the method isn't supported.
  3. Minimal Dependencies:

    • No additional libraries were added. The SDK remains lightweight and efficient.
  4. MAUI Compatibility:

    • Resolved crashes by manually setting HostManifestData during initialization.
    • Fully tested on Windows, Android, and macOS (iOS untested by me).
    • SDK should AS Secured if not theorically more secured than currently as it simply now has the modern methods (and very minimal needed changes)

As my Live Queries repo is also ready if needed, I'll just name the Live Queries Enhancements I did as well

  1. WebSocket Overhaul:

    • Replaced the outdated WebSocket implementation with System.Net.WebSockets.Client, and all the related methods, ensuring stability and scalability.
    • To avoid nerding out as the codes would do best for me, I simply updated the project to follow the new .NET flows/standards as much as I could
  2. Real-Time Reliability:

    • Thorough testing ensured stability during connection loss, reconnections, and high-frequency updates.
  3. Feature Parity:

    • Integrated feature parity with other Live Query implementations in Parse’s ecosystem while aligning with .NET’s architecture.

Challenges and My Approach

1. Addressing Legacy Code:

Porting Live Queries from .NET 2 involved unraveling contextually outdated async patterns, undocumented flows, and unsupported APIs. I approached this by:

  • Just being the debugger's best buddy ! (jk! well..)
  • I simply ensured to to use breakpoints on each step and the call stack to understand how the commands flow and I used VS's tool to visualize thread interactions (when testing for concurrency and most critical, low level bugs/vulnerabilities that were done)
  • Refactoring methods to fit .NET 9’s architecture while preserving the core functionality.

2. Ensuring Cross-Platform Stability:

MAUI introduces unique challenges, particularly with platform-specific configurations like HostManifestData. I resolved this by implementing a manual initialization process that ensures stability across Windows, Android, and macOS.

3. Testing and Documentation:

While this PR lacks comprehensive unit tests, I’ve included:

  • A sample chat application demonstrating Live Queries in action (built with .NET MAUI).
  • Documentation for setting up Live Queries and Parse SDK in .NET 9/Maui projects.

I welcome collaboration to expand test coverage and improve documentation further.


Why No Unit Tests?

I want to address this head-on because I know it’s an important topic.

The truth is:

I’ve never had the opportunity to learn unit testing properly. It’s something I’ve always envied in others who do it effortlessly.
My coding experience has been shaped by a more hands-on, old-school approach—debugging and breaking my code manually to understand and refine it.
While this approach has worked well for me so far, I recognize the value of formalized testing. Most methods in the updated SDK retain the same flow, so I believe existing test suites (if available) would require minimal adjustment. I welcome collaboration from the community to help add meaningful tests.

  • Platforms I tested on:
    • Windows, Android, macOS (stable).
    • iOS (untested but expected to function consistently).
  • Included sample app: A simple chat application demonstrating Live Queries integration in .NET MAUI.

On Adherence to Guidelines:

While I didn’t strictly follow all project guidelines, I maintained the core functionality and flow of the SDK. My focus was on modernizing outdated patterns and ensuring stability, especially for .NET MAUI compatibility and Live Queries.

Any deviations (e.g., updated async patterns or additional comments) were intentional, aimed at improving readability, maintainability, and scalability. I look forward to working with the community to align this further with Parse’s standards.


Acknowledgments

I want to thank:

  • The Parse Team and Parse DOTNET SDK Team: Your work inspired me to take on this challenge and helped me get out of a situation by helping me put food on the table, and I’m honored to contribute and help others do same!
  • Back4App: Thank you for your support and great platform (All I will say, is Check it out!)
  • JonMcPherson: Your foundational work on Live Queries laid the groundwork for this project.

Next Steps

This PR is just the beginning. I’m eager to collaborate with the Parse community to:

  1. Expand unit testing for both the SDK and Live Queries.
  2. Optimize the architecture further to align with Parse’s standards.
  3. Explore additional features and enhancements that benefit the broader developer base (As I personally use it, I have a personal commitment to make Parse better for my uses so my contribution is one that cna be counted on)

Final Thoughts

This PR isn’t about pushing a solution; it’s about opening a door. Live Queries, .NET 9 AND MAUI support represent the next step forward for Parse, and I’m excited to help make it happen.

Hopefully at least it helps ANYONE in need and closes that near-decade old issue

Happy coding,

Yvan Brunel


This should first and foremost close #199

Links

- Removed `xmlns:m` namespace declaration for `UraniumUI.Icons.MaterialSymbols` in `AppShell.xaml`.
- Replaced `ImageButton` with `Button` for delete button in `AppShell.xaml`.
- Updated `Tab` elements in `AppShell.xaml` to use image icons.
- Conditionally set database path in `DataBaseService.cs` based on `NET9_0`.
- Added `<AppxSymbolPackageEnabled>false</AppxSymbolPackageEnabled>` to `Dimmer-MAUI.csproj`.
- Added new property groups for configurations and target frameworks in `Dimmer-MAUI.csproj`.
- Changed active debug framework and profile to Windows in `Dimmer-MAUI.csproj.user`.
- Updated version in `Package.appxmanifest` from `0.4.0.0` to `0.5.0.0`.
- Updated publish settings in `MSIX-win-x64.pubxml` and `MSIX-win10-x86.pubxml`.
- Added new SVG and PNG icon files.
- Conditionally compile code for Android and Windows in various services and view models based on `NET9_0`.
- Updated `MediaPlaybackControlsView.xaml` to use new image sources and added triggers for shuffle state.
- Fixed issues in `SingleSongShellPageD.xaml.cs` and `SingleSongShell.xaml`.
- Updated `Parse.csproj` to support multiple target frameworks and added a conditional target framework for Windows.
- Added new publish profile `FolderProfile.pubxml`.
- Updated `Resources.Designer.cs` to use `StronglyTypedResourceBuilder` version "17.0.0.0".
- AppShell.xaml: Added TouchDownCommand, removed redundant elements.
- AppShell.xaml.cs: Made ToggleFlyout calls synchronous, added empty event handler.
- SongsManagementService.cs: Explicit constructor call for SongModel.
- Dimmer-MAUI.csproj: Changed RuntimeIdentifier to win10-x64.
- Dimmer-MAUI.csproj.user: Updated debug settings for Windows.
- GeneralStaticUtilities.cs: Added null check for item.FilePath.
- LyricsService.cs: Improved null handling, added .lrc parsing.
- ArtistsSection.HomePageVM.cs: Handled nullability, added partial methods.
- ArtistsPageD.xaml: Added DataTrigger for Label styling.
- ArtistsPageD.xaml.cs: Refactored ArtistView_TouchDown.
- DimmerWindow.xaml.cs: Updated version subtitle to v0.5.1.
- MainPageD.xaml: Added TouchDown event handler, simplified Image binding.
- MainPageD: Added isPointerEntered field, implemented PointerEntered method.
- SingleSongShellPageD.xaml: Updated IsAnimationPlaying, added SfChipGroup.
- SingleSongShellPageD.xaml.cs: Added chip click handler, debugging using directive.
- ArtistsPageM.xaml.cs: Removed async from ResetSongs_TapPressed, added background color changes.
- Added pragma directives to suppress warnings, added comments for refactoring.
Updated target frameworks and project references:
- `ParseLiveQuery.Test.csproj` to `v4.8`
- `ParseLiveQuery.csproj` to `net9.0`
- Removed `Parse` and `WebSocketSharp` references, added `System.Text.Json` and `websocketsharp.core`
- Updated `Parse.csproj` to use `OpenCover` v4.7.1221

Refactored `ParseLiveQueryClient.cs`:
- Switched to `System.Text.Json` for JSON parsing
- Added `_clientKey` field and updated constructor
- Updated methods to use `ParseClient.Instance` for various operations
- Adopted file-scoped namespace syntax

Updated other client operations:
- Replaced `Json.Encode` with `JsonSerializer.Serialize` in `SessionClientOperation.cs` and `UnsubscribeClientOperation.cs`
- Updated `SubscribeClientOperation.cs` to use `ParseClient.Instance.CreateObjectWithoutData<T>(null).ClassName`

Enhanced `ObjectServiceExtensions.cs`:
- Added validation and error handling in `GetFieldForPropertyName` method
- Included `System.Diagnostics` namespace

Updated Visual Studio solution:
- Made compatible with Visual Studio 17
- Removed `ParseLiveQuery.Test` project, added `Parse` project
Updated App.xaml.cs to initialize platform-specific shells and replaced Console.WriteLine with Debug.WriteLine. Enhanced AppShell.xaml and AppShellMobile.xaml with new tabs and routes. Expanded IFlowsService.cs with new methods for user accounts and synchronization. Renamed and refactored FlowService.cs with extensive updates for user authentication, data synchronization, and error handling. Added project references and updated FlowHub-MAUI.csproj and FlowHub-MAUI.sln. Refactored data models in FlowModel.cs and enhanced HomePageVM.cs with new properties and commands. Updated various XAML files for improved UI and data binding. Refactored multiple files in ParseLiveQuery to use file-scoped namespaces, improved formatting, and updated WebSocket implementation. Enhanced MutableObjectState, ParseObject, and related classes with new properties, error handling, and logging. Updated ParseUser.cs and service extensions for better user management.
The changes primarily involve refactoring methods to use block bodies instead of expression bodies across multiple files. This improves readability and maintainability by making the code more consistent and easier to debug.

Key changes include:
- Refactored methods in various files such as `HomePageVM.cs`, `ConnectClientOperation.cs`, `ParseLiveQueryClient.cs`, `CacheController.cs`, `ParseAddOperation.cs`, `ParseObjectCoder.cs`, `ParseCommandRunner.cs`, `ParseConfiguration.cs`, `ParseObject.cs`, `ParseQuery.cs`, `ParseUser.cs`, `ParseUserController.cs`, `AnalyticsServiceExtensions.cs`, `CloudCodeServiceExtensions.cs`, `ConfigurationServiceExtensions.cs`, `InstallationServiceExtensions.cs`, `ObjectServiceExtensions.cs`, `ParseExtensions.cs`, `ParseFileExtensions.cs`, `ParseQueryExtensions.cs`, `ParseRelationExtensions.cs`, `ParseUserExtensions.cs`, `PushServiceExtensions.cs`, `QueryServiceExtensions.cs`, `RoleServiceExtensions.cs`, `SessionsServiceExtensions.cs`, and `UserServiceExtensions.cs` to use block bodies.
- Added logging and debug statements in some files to track changes and improve clarity.
- Introduced hardcoded values for user credentials in `HomePageVM.cs` and added logging for user authentication status changes.
- Added null checks and validation logic in some methods to ensure robustness.
Copy link

parse-github-assistant bot commented Dec 5, 2024

Thanks for opening this pull request!

  • ❌ Please link an issue that describes the reason for this pull request, otherwise your pull request will be closed. Make sure to write it as Closes: #123 in the PR description, so I can recognize it.

@YBTopaz8 YBTopaz8 changed the title Upgrade SDK to .NET 9 / MAUI with ready support for Parse Live Queries Add Live Queries (Now Ready Separately As Well) feat: Upgrade SDK to .NET 9 / MAUI with ready support for Parse Live Queries Add Live Queries (Now Ready Separately As Well) Dec 5, 2024
@mtrezza
Copy link
Member

mtrezza commented Dec 8, 2024

Amazing, a lot of time must have gone into this. It will take some time to review this, but I've at least been able to start the CI to see how that goes.

@mtrezza mtrezza changed the title feat: Upgrade SDK to .NET 9 / MAUI with ready support for Parse Live Queries Add Live Queries (Now Ready Separately As Well) feat: Upgrade SDK to .NET 9 / MAUI with support for Parse LiveQuery Dec 8, 2024
@mtrezza mtrezza changed the title feat: Upgrade SDK to .NET 9 / MAUI with support for Parse LiveQuery feat: Upgrade SDK to .NET 9 / MAUI with support for LiveQuery Dec 8, 2024
@mtrezza mtrezza changed the title feat: Upgrade SDK to .NET 9 / MAUI with support for LiveQuery feat: Upgrade to .NET 9 / MAUI with support for LiveQuery Dec 8, 2024
Copy link
Member

@mtrezza mtrezza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you take a look at the failing CI?

@YBTopaz8
Copy link
Member Author

YBTopaz8 commented Dec 8, 2024

Hi !
Thanks.

From what I see, the build fails mainly due to the UnitTest likely looking to validate the previous methods (I can see it mention unwrap() )
Fortunately for me , I started learning on UT so I should be able to at least update those tests so that they pass for a successful merge.

Please give me some time and I should be committing soon.

@mtrezza
Copy link
Member

mtrezza commented Dec 8, 2024

@YBTopaz8 Would you like me to add you to the Parse .NET SDK review team? You'd get a notification when a contributor's PR is ready for review.

- All Currently Written tests are updated to test the latest code
- Parse previously targeted only .NET 9+, now it does .NET6+
- Did some "Todo" along the side.
- Ensured all tests while updated, still pass as intended.
- Sets base compatibility to .NET 5+ (versions 5, 6, 7, 8, 9), including support for .NET MAUI, ensuring broader platform compatibility.
- Enables compatibility for Live Queries with the updated base compatibility.
- Completed most, if not all, TODOs, including implementing additional unit tests to cover newly introduced concepts.
- Finalized remaining TODOs and ensured all functionality is thoroughly tested.
@YBTopaz8
Copy link
Member Author

I've had this this version running for a while now without issues, but had no tests done. So, now I've just updated Unit Tests, added new ones for new stuff added too, and they all pass now.
I originally targeted only .NET 9 since MAUI was my focus, but I then went as low as .NET 5 as that is reasonably old for me.

@mtrezza Hi, Sure it would be a pleasure.

Just FYI, I'm updating Live Queries lib too, that way it can target same as Parse, if the community is interested in officially having LQ lib, I'd be glad to give my improvements on it & may throw some updates here and there.

Best.

@mtrezza
Copy link
Member

mtrezza commented Dec 10, 2024

Great, restarted the CI... contributions are always highly welcome, especially in the .NET SDK, which didn't get much TLC in the past years.

@dblythy
Copy link
Member

dblythy commented Dec 11, 2024

Had a quick look and a fair few of the changes seem to be linting related - my suggestion would be to revert the File Scoped Namespaces change so it's a bit easier to review, and then address the File namespaces in a sepeate PR (that way this PR can just be the required changes)

Would also suggest modularising some of the LiveQuery code into its own files (the diff here has no added files which I think is strange)

If you could, could you let me know which classes have been added/changed in this PR (and isn't a lint change)

Parse/Platform/Files/FileState.cs Show resolved Hide resolved
Parse/Infrastructure/CacheController.cs Outdated Show resolved Hide resolved
Parse/Infrastructure/CacheController.cs Outdated Show resolved Hide resolved
Parse/Infrastructure/CacheController.cs Outdated Show resolved Hide resolved
@YBTopaz8
Copy link
Member Author

Okay, it might be a very long reply;
File Changed : Parse/Infrastructure/HostManifestData.cs

  • Updated public static HostManifestData Inferred for MAUI compatibility (should work for Unity as well)

File: Parse/Utilities/ObjectServiceExtensions.cs

  • Updated GetFieldForPropertyName as previous impl didn't account for some cases

Files: Parse/Infrastructure/Data/ParseDataDecoder.cs & Parse/Infrastructure/Data/ParseObjectCoder.cs

  • Did a overhaul, pretty much

File: Parse/Infrastructure/Execution/ParseCommandRunner.cs

  • Fixed a bug where then new way of receiving errors from Parse wasn't done, so positive error messages came out as Exceptions (simply had to receive them as docs)
  • Updated the way exceptions are handled. It's more graceful and crashes only when dev needs to act.
    In fact the whole lib is as such now - It should not crash if it can simply return null or so.

File: Parse/Platform/Objects/MutableObjectState.cs

  • Updated to handle more data-better

Files : Parse/Platform/Objects/ParseObjectClass.cs and Parse/Platform/Objects/ParseObjectClassController.cs

File: Parse/Utilities/UserServiceExtensions.cs

  • Updated methods to new async/await ways.

File: Parse/Infrastructure/Utilities/JsonUtilities.cs

  • Updated for Parity (better encoding/returns)

Files: Parse/Platform/Users/ParseUserController.cs , Parse/Platform/Users/ParseCurrentUserController.cs, Parse/Platform/Users/ParseUser.cs

  • Overhauled
    File: Parse/Platform/Installations/ParseInstallationController.cs
  • Fixed some issues with installation ID making it crash on some plats (will still comeback for those Mutex if need be).

File : Parse/Abstractions/Platform/Objects/IObjectState.cs

  • Added INotifyPropertyChanged follow a UT, I suppose it's useful!

Parse/Abstractions/Platform/Objects/IParseObjectController.cs,

  • SaveAll and DeleteAll now expect Any Enumerable and not just ILists. Users can now use arrays etc..

Parse/Infrastructure/Utilities/Conversion.cs

  • Now accounts for most if not all file types

Parse/Platform/Security/ParseACL.cs

  • Updated to handle nested ACLs too if any

Added Support for .net 5,6,7,8,9 and MAUI.
I didn't mention changed I made before (other async changes etc)

I updated this <PackageReference Include="OpenCover" Version="4.7.1221" />

Here is a full overview of what's done @dblythy !

Also, about Parse Live Query, I added No file because I believe it's best to keep it as an optional library.
I do have one all setup and updated (I pushed an update yesterday to now use RX.NET to allow for LINQ support - I believe .NET will be the only platform with LINQ support on LQ which is quite cool!

If the Parse Community is interested, I can help make it officially its.
Just let me know! I will Not be handling any Unit Tests though - sorry! Doing that for Parse was enough field day for me.

The Live Queries Lib is online and already having little over 70 downloads in Nugets , no Negative Feedback since it's out and even internally, I've had no issues.

If interested, of course, kindly ping me.

@dblythy
Copy link
Member

dblythy commented Dec 11, 2024

Thank you for providing that documentation @YBTopaz8! No worries, I misunderstood - was thinking the livequery code was part of this PR. Having it as a seperate package is clean. I'll go in again tomorrow and review the classes you mentioned.

Appreciate your contribution - this will be a valuable uplift!

@YBTopaz8
Copy link
Member Author

It's a pleasure!
I find the potential for Parse and especially Live Queries (and now with LINQ) to make it much much better for any kind of users (especially the power users who do a lot of data manipulation).

I'll Actually try to do a full documentation of what's changed what's added/removed (probably nothing if not bugs) and how to use new methods I added.

It's a pleasure to help again, and I appreciate you all!
Lmk If there's any changes done that need a review!

@mtrezza
Copy link
Member

mtrezza commented Dec 11, 2024

I also assumed LiveQuery was part of this PR. So we need to remove that from the PR title, right?

@YBTopaz8
Copy link
Member Author

Yes!

I am using it in my project - building a cross plat, cross sync music player app
https://github.com/YBTopaz8/Dimmer-MAUI

And my sample Maui chat app that uses the latest version of LQ since it's the demo project.
https://github.com/YBTopaz8/Chat-App-.NET-MAUI-LIVE-QUERY

I'm fine with waiting as long as it fits the guidelines as well

@mtrezza
Copy link
Member

mtrezza commented Dec 13, 2024

That's great that you are using it, so I'd merge this without further ado. @dblythy, fine with you?

@mtrezza
Copy link
Member

mtrezza commented Dec 16, 2024

@YBTopaz8 Before we merge, I'd like to confirm with you that this PR doesn't contain any breaking changes, is that correct? If so, we'll release this as a feature release, otherwise we'd release as a major release.

@YBTopaz8
Copy link
Member Author

Correct, this PR does not contain any breaking changes as far as I've checked. It's more of a "facelift," modernizing the codebase and readying it for Live Query integration, so it's good to go.

To ensure reliability, I’ve extensively tested it across platforms, including Android WearOS. It worked flawlessly, even in a real-time chat app with full CRUD functionality running across multiple platforms: Here. I also built a native watch app for my cross-platform music app (Here too).

If I had a smart fridge, I’d have tested it there too! 😄
That said, I believe this qualifies as a major release because it modernizes the codebase and officially drops support for older .NET versions. Of course, I'm happy to wait if further review or consolidation is required.

@YBTopaz8
Copy link
Member Author

Do Grant me a moment though.
I would like to push a final commit removing unnecessary debug lines (that print out both dumb and valuable data)
Should be done in a bit

@mtrezza
Copy link
Member

mtrezza commented Dec 16, 2024

officially drops support for older .NET versions.

Does it? That would quality as a breaking change. I thought the breaking change would come with the next PR where we'll remove the .NET 6 and 7 support?

@YBTopaz8
Copy link
Member Author

Ohh, you would be right indeed!
I suppose .NET 6 has support for previous versions too so - Yes I was mistaken!
No breaking change there.

@mtrezza
Copy link
Member

mtrezza commented Dec 17, 2024

Did some research. Currently the Parse .NET SDK is targeting netstandard2.0 which is old but provides compatibility with many platforms like Unity, Xamarin, etc. That will be gone with this PR which targets .NET.

I think this change makes strategic sense because that's the future:

  • Microsoft stopped development of netstandard, and is encouraging developers to shift to .NET.
  • Unit 7 is working on migrating to CoreCLR, but that will take time, maybe with Unity 7 in 2025 / 2026.
  • Xamarin has evolved into .NET MAUI and Microsoft has stopped Xamarin support on May 1, 2024.

So yes, this is a breaking change. Given that the Parse .NET SDK didn't receive much TLC for years I'd say let's go ahead with this modernization and focus on .NET. Unless this PR still builds when targeting netstandard2.0, but I assume it won't anymore?

TODOs:

  • Remove Xamarin, Unity references from the SDK.
  • Remove Xamarin, Unity references from docs.

@mtrezza mtrezza added the state:breaking Breaking change requires major version increment and `BREAKING CHANGE` commit message label Dec 17, 2024
@YBTopaz8
Copy link
Member Author

This is right !
Well, In the case where apps target .net (which is understandable tbh!) can use v.3.0.2
Those who can switch to .net 6 targeting will simply update to latest.

Since Xamarin has evolved into .NET MAUI and is now unsupported (as of May 1, 2024), the decision to drop netstandard2.0 eliminates reliance on outdated technologies.

& Also
Unity's move to CoreCLR is still a work in progress and won’t be fully ready until Unity 7 (likely 2025/2026). For now, Unity developers targeting .NET Standard can continue using older versions of the Parse SDK if needed.

And I'm pretty sure I fixes to MAUI does fix unity in most if not all cases as they seem to operate pretty much same.

& Finally, I fixed the logout issue found in unity only that moved to Maui since they are mostly treated the same as MAUI.
Issue was: The client instance used to logout had too much "unnecessary" info that would, for some reasons lead to a 403 - unauthorized request instead of a 200-OK or 400-Bad.
so after numerous back and forth with postman, I could confirm that.

I'll add a simple condition to use a vanilla webclient with only the data needed for very simple operations.

Expect a final commit fixing that . (Maybe I'll fix the unit test too as well! Finally after months!)

@YBTopaz8
Copy link
Member Author

Just to reassure you, pray least seeing this another around would me

  1. Leaving support for old tech - it's a logical choice now even for companies since new .net versions have clear differences in performance they'd naturally enjoy + security robustness.

  2. It solves many unity issues that carried to .net and thank I fixed likely out of necessity but didn't know since I might not best suited for that! (But if I have it so working on a Watch then it failing on unity would be interesting to see!)

  3. These code changes are fully compatible with the Parse Live Queries SDK - if that was worry of yours - no need!

All the changes do here are tested WITH LQ first, then with UTests.

I'm wondering how Parse will manage that for .net

Will you make it a standalone extension ? Or merge like Parse for Swift Did? You tell me in due time of course!

It used to freeze app before but doesn't now.
- SignUpAsync now returns the Signed up user after completion
- Renamed LoginAsync() to LoginWithAsync() and SignUpAsync() to SignUpWithAsync().
- Finished removing old codes.
- Possibily fixed all OLD Unity issues.
@YBTopaz8
Copy link
Member Author

YBTopaz8 commented Dec 17, 2024

Unit Tests all run as expected. Logout still fails because I can't mock it properly.
I give up for now at least.

I fixed my main issue which was that it would freeze/crash app.

And since we opted to release as breaking change, I went ahead and implemented the Todos that required method name changes..
Also exposed some others and error handling should be much better

image

@YBTopaz8
Copy link
Member Author

Perfection.

@mtrezza mtrezza changed the title feat: Upgrade to .NET 9 / MAUI feat: Upgrade target framework from netstandard2.0 to .NET 6 Dec 19, 2024
@mtrezza mtrezza changed the title feat: Upgrade target framework from netstandard2.0 to .NET 6 feat: Upgrade target framework from netstandard2.0 to .NET 6.0 Dec 19, 2024
@mtrezza mtrezza changed the title feat: Upgrade target framework from netstandard2.0 to .NET 6.0 feat: Upgrade target framework from NET Standard 2.0 to .NET 6.0 Dec 19, 2024
@mtrezza mtrezza merged commit 1d4ab13 into parse-community:master Dec 19, 2024
5 checks passed
parseplatformorg pushed a commit that referenced this pull request Dec 19, 2024
# [4.0.0](3.0.2...4.0.0) (2024-12-19)

### Features

* Upgrade target framework from NET Standard 2.0 to .NET 6.0 ([#393](#393)) ([1d4ab13](1d4ab13))

### BREAKING CHANGES

* This release requires .NET 6.0 or later and removes compatibility with NET Standard 2.0; Xamarin developers should migrate to .NET MAUI to use this version of the Parse SDK; Unity developers should use the previous SDK version until Unity supports .NET. ([1d4ab13](1d4ab13))
@parseplatformorg
Copy link

🎉 This change has been released in version 4.0.0

@parseplatformorg parseplatformorg added the state:released Released as stable version label Dec 19, 2024
@YBTopaz8
Copy link
Member Author

Lovely!
Now I can literally open a PR right now to add Parse Live Queries (+ some code fixes I finally got working with Parse LQ)

The one thing with LQ is that I do not have any Unit Tests so in that light, I admit, I do not know what to do best and would appreciate your advice!.

Lastly, as mentioned above, there was an interesting issue I spotted that has to do with Cloud Jobs in .NET where they don't pass the sessionToken as param, leading to Parse fxns needed auth to never run.
I saw and fixed then tested the solution and would really hoping to push it TODAY but you were faster than me haha.

I will open a PR for that in a few.
Thanks @mtrezza 🙂

@mtrezza
Copy link
Member

mtrezza commented Dec 20, 2024

I suggest you post this comment on #199 to have a discussion. I noticed that the issue was linked incorrectly, because it was about adding LiveQuery to the SDK, but this PR did not add LiveQuery, so I've reopened it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state:breaking Breaking change requires major version increment and `BREAKING CHANGE` commit message state:released Released as stable version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Are you planning to implement LiveQuery in dotnet sdk?
4 participants