Skip to content

Commit

Permalink
fix(grpc-sdk): push notifications responses type mismatch (#731)
Browse files Browse the repository at this point in the history
* build(deps-dev): bump lerna from 6.6.1 to 7.3.1

Bumps [lerna](https://github.com/lerna/lerna/tree/HEAD/packages/lerna) from 6.6.1 to 7.3.1.
- [Release notes](https://github.com/lerna/lerna/releases)
- [Changelog](https://github.com/lerna/lerna/blob/main/packages/lerna/CHANGELOG.md)
- [Commits](https://github.com/lerna/lerna/commits/v7.3.1/packages/lerna)

---
updated-dependencies:
- dependency-name: lerna
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* chore: update lerna.json

* fix(grpc-sdk): notifications type mismatch between returned responses and expected

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Loading branch information
kkopanidis and dependabot[bot] authored Oct 12, 2023
1 parent 6e9bb63 commit 2b981c5
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions libraries/grpc-sdk/src/modules/pushNotifications/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ import { ConduitModule } from '../../classes/ConduitModule';
import { PushNotificationsDefinition } from '../../protoUtils/push-notifications';

export class PushNotifications extends ConduitModule<typeof PushNotificationsDefinition> {
constructor(private readonly moduleName: string, url: string, grpcToken?: string) {
constructor(
private readonly moduleName: string,
url: string,
grpcToken?: string,
) {
super(moduleName, 'push-notifications', url, grpcToken);
this.initializeClient(PushNotificationsDefinition);
}
Expand All @@ -21,7 +25,9 @@ export class PushNotifications extends ConduitModule<typeof PushNotificationsDef
return this.client!.getNotificationTokens({
userId,
}).then(res => {
return res.tokenDocuments;
return res.tokenDocuments.map((tokenDocument: string) => {
return JSON.parse(tokenDocument);
});
});
}

Expand All @@ -38,8 +44,6 @@ export class PushNotifications extends ConduitModule<typeof PushNotificationsDef
body,
data,
platform,
}).then(res => {
return JSON.parse(res.message);
});
}

Expand All @@ -50,8 +54,6 @@ export class PushNotifications extends ConduitModule<typeof PushNotificationsDef
) {
return this.client!.sendManyNotifications({
notifications,
}).then(res => {
return JSON.parse(res.message);
});
}

Expand All @@ -68,8 +70,6 @@ export class PushNotifications extends ConduitModule<typeof PushNotificationsDef
body,
data,
platform,
}).then(res => {
return JSON.parse(res.message);
});
}
}

0 comments on commit 2b981c5

Please sign in to comment.