parse-community / Parse-SDK-JS

The JavaScript SDK for Parse Platform
https://parseplatform.org
Apache License 2.0
1.33k stars 597 forks source link

feat: Allow setting custom queue for handling offline operations via `Parse.EventuallyQueue` #2106

Closed mortenmo closed 6 months ago

mortenmo commented 6 months ago

EventuallyQueue behavior isn't always what I need. Was hoping to have a way to replace the default to change the behavior. Using CoreManager felt like the obvious way.

Issue

EventuallyQueue gives you no control over what happens if there are conflicts. For example, another client has changed the object, it just looks at updatedAt time and drops the local changes. Fine as a general rule, but sometimes I need some control over that in an often offline environment.

Approach

There were only 3 places that called EventuallyQueue directly. Just changed those to use CoreManager.getEventuallyQueue() following the patterns of most other things going through CoreManager.

Tasks

parse-github-assistant[bot] commented 6 months ago

Thanks for opening this pull request!

dplewis commented 6 months ago

Looks good! I think you may have fixed a circular dependency as well.

codecov[bot] commented 6 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 100.00%. Comparing base (72bc9ac) to head (7bd2a22). Report is 13 commits behind head on alpha.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## alpha #2106 +/- ## =========================================== + Coverage 99.98% 100.00% +0.01% =========================================== Files 61 64 +3 Lines 6185 6208 +23 Branches 1499 1503 +4 =========================================== + Hits 6184 6208 +24 + Misses 1 0 -1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

dplewis commented 6 months ago

@mtrezza This is ready for review. I'm not sure why the CI isn't running

mtrezza commented 6 months ago

Does the PR title make sense?

mortenmo commented 6 months ago

Yeah I believe so

parseplatformorg commented 6 months ago

🎉 This change has been released in version 5.1.0-alpha.6

parseplatformorg commented 5 months ago

🎉 This change has been released in version 5.1.0-beta.1

parseplatformorg commented 5 months ago

🎉 This change has been released in version 5.1.0