Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
notifications-bot
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
archives
notifications-bot
Commits
b11e23cc
Commit
b11e23cc
authored
Jan 7, 2022
by
Jonah Husson
Browse files
Options
Downloads
Patches
Plain Diff
More comment/logging fixes
parent
92c23bee
No related branches found
No related tags found
2 merge requests
!32
Release
,
!25
Restructure notification code for batching
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
notifications/notifications.go
+4
-2
4 additions, 2 deletions
notifications/notifications.go
with
4 additions
and
2 deletions
notifications/notifications.go
+
4
−
2
View file @
b11e23cc
...
...
@@ -50,6 +50,8 @@ type Params struct {
NotificationRate
int
APNS
APNSParams
}
// APNSParams holds config info specific to apple's push notification service
type
APNSParams
struct
{
KeyPath
string
KeyID
string
...
...
@@ -58,7 +60,7 @@ type APNSParams struct {
Dev
bool
}
//
Local i
mpl for notifications; holds comms, storage object, creds and main functions
//
I
mpl for notifications; holds comms, storage object, creds and main functions
type
Impl
struct
{
Comms
*
notificationBot
.
Comms
Storage
*
storage
.
Storage
...
...
@@ -249,7 +251,7 @@ func (nb *Impl) notify(csv string, toNotify storage.GTNResult) {
// 400 can also indicate incorrect token, do extra checking on this (12/27/2021)
// Error documentation: https://firebase.google.com/docs/reference/fcm/rest/v1/ErrorCode
// Stale token documentation: https://firebase.google.com/docs/cloud-messaging/manage-tokens
jww
.
ERROR
.
Printf
(
"Error sending notification: %+v"
,
err
)
jww
.
ERROR
.
Printf
(
"Error sending notification
via FCM
: %+v"
,
err
)
invalidToken
:=
strings
.
Contains
(
err
.
Error
(),
"400"
)
&&
strings
.
Contains
(
err
.
Error
(),
"Invalid registration"
)
if
strings
.
Contains
(
err
.
Error
(),
"404"
)
||
invalidToken
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment