Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor/notify #1906

Open
wants to merge 37 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
3690202
updated backend according to the mobile-app signIn with github flow
shreya-mishra Sep 22, 2023
4b16d22
added testcase
shreya-mishra Sep 25, 2023
88464df
added testcase
shreya-mishra Sep 25, 2023
14e96bb
added testcase
shreya-mishra Sep 25, 2023
ba15e48
added testcase
shreya-mishra Sep 25, 2023
b4f5498
added testcase
shreya-mishra Sep 25, 2023
ccdfe96
added testcase
shreya-mishra Sep 25, 2023
3e3a067
added testcase
shreya-mishra Sep 25, 2023
ea41739
added testcase
shreya-mishra Sep 25, 2023
fe892cf
added testcase
shreya-mishra Sep 25, 2023
631e766
api's for notification service
shreya-mishra Nov 3, 2023
b21d886
updated notify method where we will be fetching userId from the disco…
shreya-mishra Nov 8, 2023
2770b03
notify refactor
shreya-mishra Nov 14, 2023
c56984f
started writing test of models
shreya-mishra Nov 14, 2023
238326f
Merge branch 'develop' into NotifyServiceFtReq
shreya-mishra Nov 14, 2023
26756c2
done with fcm
shreya-mishra Nov 16, 2023
15f9435
services test
shreya-mishra Nov 18, 2023
9d3f8e9
added middleware test cases
shreya-mishra Nov 18, 2023
c04c72c
added integration test
shreya-mishra Nov 20, 2023
f0c8201
fix notify-test
shreya-mishra Nov 20, 2023
07c6eaa
skipping mocking firebase messaging service for now
shreya-mishra Nov 24, 2023
726dc18
skipping mocking firebase messaging service for now
shreya-mishra Nov 24, 2023
269e3d2
prettier fix
shreya-mishra Nov 27, 2023
aa1463d
Merge branch 'develop' into NotifyServiceFtReq
shreya-mishra Nov 27, 2023
a3cfe0d
updated the notification route as per the api contract
shreya-mishra Dec 5, 2023
e0c8163
updated the notification route as per the api contract
shreya-mishra Dec 5, 2023
30daafe
resolved the comment
shreya-mishra Dec 6, 2023
c946476
resolved the comment
shreya-mishra Dec 6, 2023
5c7323c
resolved the comments
shreya-mishra Dec 6, 2023
4377f55
removed the comment
shreya-mishra Dec 7, 2023
4a8922a
fix the status code
shreya-mishra Dec 7, 2023
6c4d06d
resolved the inconsistent return issue
shreya-mishra Dec 7, 2023
3743820
Merge pull request #1682 from Real-Dev-Squad/Test/Notify
shreya-mishra Dec 7, 2023
d47f827
Merge branch 'NotifyServiceFtReq' into refactor/notify
shreya-mishra Dec 7, 2023
76302bb
resolved the comments
shreya-mishra Dec 7, 2023
c88a239
accepted the suggestion
shreya-mishra Dec 7, 2023
c84811d
added failing test cases
shreya-mishra Dec 7, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
updated the notification route as per the api contract
  • Loading branch information
shreya-mishra committed Dec 5, 2023
commit a3cfe0d253ed847ae412af92c10f98b5baa620e2
11 changes: 11 additions & 0 deletions controllers/notify.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,18 @@ const notifyController = async (req, res) => {
},
tokens: Array.from(setOfFcmTokens),
};
function calculateMessageSize(message) {
const byteArray = new TextEncoder().encode(message);

const byteLength = byteArray.length;

const kilobytes = byteLength / 1024;

return kilobytes;
}
if (calculateMessageSize(message) <= 2) {
res.error(401).send("Message length exceeds");
}
// Save the FCM token to your database or perform other necessary actions.
// You can associate the token with a user or device, for example.

Expand Down
4 changes: 2 additions & 2 deletions routes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ app.use("/issues", require("./issues.js"));
app.use("/progresses", require("./progresses.js"));
app.use("/monitor", require("./monitor.js"));
app.use("/staging", require("./staging.js"));
app.use("/fcm-token", require("./fcmToken.js"));
app.use("/notify", require("./notify.js"));
app.use("/v1/fcm-tokens", require("./fcmToken.js"));
app.use("/v1/notifications", require("./notify.js"));
app.use("/goals", require("./goals.js"));
module.exports = app;
Loading