MCPcopy
hub / github.com/parse-community/parse-server / removeConflictingDeviceToken

Function removeConflictingDeviceToken

src/InstallationDedup.js:65–97  ·  view source on GitHub ↗
({
  database,
  query,
  action,
  enforceAuth,
  runOptions,
  validSchemaController,
})

Source from the content-addressed store, hash-verified

63 * @param {SchemaController} options.validSchemaController
64 */
65export async function removeConflictingDeviceToken({
66 database,
67 query,
68 action,
69 enforceAuth,
70 runOptions,
71 validSchemaController,
72}) {
73 const opts = enforceAuth ? runOptions : {};
74 try {
75 await performAction({
76 database,
77 query,
78 action,
79 fieldToClear: 'deviceToken',
80 runOptions: opts,
81 many: true,
82 validSchemaController,
83 });
84 logResult(action, null, null);
85 } catch (err) {
86 if (err && err.code === Parse.Error.OBJECT_NOT_FOUND) {
87 logResult(action, 0, err);
88 return;
89 }
90 if (err && err.code === Parse.Error.OPERATION_FORBIDDEN) {
91 logResult(action, null, err);
92 return;
93 }
94 logResult(action, null, err);
95 throw err;
96 }
97}
98
99/**
100 * Resolves a merge conflict between two `_Installation` rows that together represent the

Callers

nothing calls this directly

Calls 2

performActionFunction · 0.85
logResultFunction · 0.85

Tested by

no test coverage detected