-
-
Notifications
You must be signed in to change notification settings - Fork 596
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
saveEventually / EventuallyQueue doesn't work when killing server -> saveEventually object -> restarting server #2028
Labels
type:bug
Impaired feature or lacking behavior that is likely assumed
Comments
Thanks for opening this issue!
|
I did make this hacky fix locally to fix the problem and it does, but not sure if its the best fix:
|
mtrezza
added
the
type:bug
Impaired feature or lacking behavior that is likely assumed
label
Sep 22, 2023
@mortenmo Do you want to open a pull request? |
This was referenced Mar 21, 2024
Fixed via #2097 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
New Issue Checklist
Issue Description
Loading an object in client, then calling saveEventually on it after killing the parseserver, then starting it up again doesn't work for me. It seems to be a few different issues. Maybe I'm just doing something really wrong, and if so I'm sorry in advance :)
Test code is really simple. I find object "Foo" (with server up) in the console, kill server, client executes this code:
I can see the
Parse.EventuallyQueue.getQueue()
have the followingWhen I restart the server, I don't see any attempts to save to server but queue is empty. It seems to fail this test in
EventuallyQueue.sendQueueCallback
under save:The code is checking is the object's updatedAt is greater than the object's createdAt, which will always be the case. My guess was that this should be
object.updatedAt > queueObject.createdAt
(when the queue object was created not the original object). hacking on the JS code did get me past this problem but it still wouldn't save.Next issue is that the EventuallyQueue stores a .toJSON of my object, which includes among other things the
ACL
object.With some extra logging, the ParseObject.save gets sent that ACL object. It fails on
ParseObject.validate(attrs)
(silently) with this:I'm not sure here if the best fix is to delete the ACL out of the json stored in EventuallyQueue or if ParseObject.validate should allow for JSON versions of the ACL, but it does fail my very simple
saveEventually
regardless.I don't normally modify ACLs on client, only server using save hooks, but taking them out would be one thing.
Another fix (although still would fail with ACLs changed on client) is to not do (in
EventuallyQueue.enqueue
):Instead of
object
being the entiretoJSON()
storing only the values of the changed keys (_getSaveJSON()
?). Or maybe change the ACL object if present back into a valid version.Steps to reproduce
Actual Outcome
Data is lost
Expected Outcome
Expected data to be saved when server starts up again.
Environment
Server
5.2.3
OSX
Local
Database
MongoDB
5.5
local
Client
4.1.0
Logs
The text was updated successfully, but these errors were encountered: