({
database,
query,
action,
enforceAuth,
runOptions,
validSchemaController,
})
| 63 | * @param {SchemaController} options.validSchemaController |
| 64 | */ |
| 65 | export 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 |
nothing calls this directly
no test coverage detected