Skip to content

Commit

Permalink
[#IP-342] update HandleNHNotifyMessageCallActivity/handler.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
gquadrati committed Sep 3, 2021
1 parent 6a555fb commit 7f1125b
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions HandleNHNotifyMessageCallActivity/handler.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { toString } from "fp-ts/lib/function";
import { pipe } from "fp-ts/lib/function";
import * as TE from "fp-ts/lib/TaskEither";
import { toString } from "../utils/conversions";
import { taskEither } from "fp-ts/lib/TaskEither";
import * as t from "io-ts";

Expand Down Expand Up @@ -58,12 +60,13 @@ export const getActivityBody = (
)
: notify(nhService, input.message.installationId, input.message.payload);

return doNotify
.bimap(
return pipe(
doNotify,
TE.bimap(
e => retryActivity(logger, toString(e)),
ActivityResultSuccess.encode
)
.map(e => {
),
TE.map(e => {
telemetryClient.trackEvent({
name: "api.messages.notification.push.sent",
properties: {
Expand All @@ -77,5 +80,6 @@ export const getActivityBody = (
});

return e;
});
})
);
};

0 comments on commit 7f1125b

Please sign in to comment.