parse-community / Parse-SDK-JS

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

Parse.Installation doesn't handle deleted Installation objects on server #2124

Closed dplewis closed 3 months ago

dplewis commented 4 months ago

New Issue Checklist

Issue Description

Deleted an installation in the database and it gets into a state where nothing works and it doesn't seem to be a way to get out of it.

The InstallationController never checks for server changes to object, so save() just fails since the local object has an id. And beyond cleaning the cache keys manually out of storage, there is no way to reset the installation locally.

Steps to reproduce

1) Save the current installation 2) Delete it via Parse Dashboard 3) Try to get the current installation and save it.

Approach

Parse Installation in the iOS SDK and this SDK should have similar functionaility.

Installations cannot be deleted

We always want [currentInstallation fetch] to succeed.

We always want [currentInstallation save] to succeed.

Actual Outcome

The cache has a mismatch with the server and fails.

Expected Outcome

Should properly save, fetch the installation always.

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

Thanks for opening this issue!

mtrezza commented 3 months ago

Hans't this been discussed somewhere before opening this issue? Could you link the other issue?

dplewis commented 3 months ago

@mtrezza It was in an already merged PR. https://github.com/parse-community/Parse-SDK-JS/pull/2119#issuecomment-2104824622