Merge remote-tracking branch 'upstream/alpha' into alpha
This commit is contained in:
@@ -1,3 +1,10 @@
|
|||||||
|
# [7.1.0-alpha.13](https://github.com/parse-community/parse-server/compare/7.1.0-alpha.12...7.1.0-alpha.13) (2024-07-01)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* Invalid push notification tokens are not cleaned up from database for FCM API v2 ([#9173](https://github.com/parse-community/parse-server/issues/9173)) ([284da09](https://github.com/parse-community/parse-server/commit/284da09f4546356b37511a589fb5f64a3efffe79))
|
||||||
|
|
||||||
# [7.1.0-alpha.12](https://github.com/parse-community/parse-server/compare/7.1.0-alpha.11...7.1.0-alpha.12) (2024-06-30)
|
# [7.1.0-alpha.12](https://github.com/parse-community/parse-server/compare/7.1.0-alpha.11...7.1.0-alpha.12) (2024-06-30)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "parse-server",
|
"name": "parse-server",
|
||||||
"version": "7.1.0-beta.1",
|
"version": "7.1.0-alpha.13",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "parse-server",
|
"name": "parse-server",
|
||||||
"version": "7.1.0-beta.1",
|
"version": "7.1.0-alpha.13",
|
||||||
"hasInstallScript": true,
|
"hasInstallScript": true,
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "parse-server",
|
"name": "parse-server",
|
||||||
"version": "7.1.0-beta.1",
|
"version": "7.1.0-alpha.13",
|
||||||
"description": "An express module providing a Parse-compatible API server",
|
"description": "An express module providing a Parse-compatible API server",
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|||||||
@@ -237,11 +237,23 @@ export function pushStatusHandler(config, existingObjectId) {
|
|||||||
) {
|
) {
|
||||||
const token = result.device.deviceToken;
|
const token = result.device.deviceToken;
|
||||||
const error = result.response.error;
|
const error = result.response.error;
|
||||||
// GCM errors
|
// GCM / FCM HTTP v1 API errors; see:
|
||||||
|
// https://firebase.google.com/docs/reference/fcm/rest/v1/ErrorCode
|
||||||
if (error === 'NotRegistered' || error === 'InvalidRegistration') {
|
if (error === 'NotRegistered' || error === 'InvalidRegistration') {
|
||||||
devicesToRemove.push(token);
|
devicesToRemove.push(token);
|
||||||
}
|
}
|
||||||
// APNS errors
|
// FCM API v2 errors; see:
|
||||||
|
// https://firebase.google.com/docs/cloud-messaging/manage-tokens
|
||||||
|
// https://github.com/firebase/functions-samples/blob/703c0359eacf07a551751d1319d34f912a2cd828/Node/fcm-notifications/functions/index.js#L89-L93C16
|
||||||
|
if (
|
||||||
|
error?.code === 'messaging/registration-token-not-registered' ||
|
||||||
|
error?.code === 'messaging/invalid-registration-token' ||
|
||||||
|
(error?.code === 'messaging/invalid-argument' && error?.message === 'The registration token is not a valid FCM registration token')
|
||||||
|
) {
|
||||||
|
devicesToRemove.push(token);
|
||||||
|
}
|
||||||
|
// APNS errors; see:
|
||||||
|
// https://developer.apple.com/documentation/usernotifications/handling-notification-responses-from-apns
|
||||||
if (error === 'Unregistered' || error === 'BadDeviceToken') {
|
if (error === 'Unregistered' || error === 'BadDeviceToken') {
|
||||||
devicesToRemove.push(token);
|
devicesToRemove.push(token);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user