Skip to content

Object not found for update _Installation #1007

Closed
@vocsygautam

Description

@vocsygautam

parse_server_sdk_flutter: ^8.0.0
FLUTTER RELEASE SDK :- 3.19.5

this is my code:
Future<void> initInstallation(String userId) async { final String? token = await setupToken(); final ParseInstallation currentInstallation = await ParseInstallation.currentInstallation(); print("Installation Entry get objectId: ${currentInstallation.objectId} userId: ${currentInstallation['UserId']} $currentInstallation"); if (currentInstallation.objectId == null) { await currentInstallation.subscribeToChannel('push'); currentInstallation.deviceToken = token; currentInstallation.set('UserId', userId); final ParseResponse pr = await currentInstallation.save(); print("Installation Entry Case 1 create result: ${pr.result} error: ${pr.error}"); } else { final ParseObject installation = ParseObject('_Installation'); installation.objectId = currentInstallation.objectId; installation.set('deviceToken', token); installation.set('UserId', userId); final ParseResponse pr = await installation.save(); print("Installation Entry Case 2 update result: ${pr.result} error: ${pr.error}"); } }

when else code run object delete from database and show error:

---- ParseException (Type: ObjectNotFound) : Code: 101 Message: Object not found for update.----

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:questionSupport or code-level question

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions