okTurtles / group-income

A decentralized and private (end-to-end encrypted) financial safety net for you and your friends.
https://groupincome.org
GNU Affero General Public License v3.0
331 stars 44 forks source link

"Mark all as read" sometimes doesn't mark notifications as read #2381

Open taoeffect opened 1 month ago

taoeffect commented 1 month ago

Problem

A revival of a previous issue but for a different reason it seems.

a b

Server logs seem to suggest that perhaps when a tab has fallen asleep or has been unloaded by Brave, something with the time gets out of whack:

[2024-10-19 07:17:32.713 -0700] ERROR (123): Debug: auth, unauthenticated, error, chel-shelter 
    Error: Authentication failed
    at Object.authenticate (/home/unpriv/gi/backend/auth.js:47:43)                                                  
    at exports.Manager.execute (/home/unpriv/gi/node_modules/@hapi/hapi/lib/toolkit.js:51:36)
    at module.exports.internals.Auth._authenticate (/home/unpriv/gi/node_modules/@hapi/hapi/lib/auth.js:258:58)
    at authenticate (/home/unpriv/gi/node_modules/@hapi/hapi/lib/auth.js:234:21)
    at Request._lifecycle (/home/unpriv/gi/node_modules/@hapi/hapi/lib/request.js:372:68)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at Request._execute (/home/unpriv/gi/node_modules/@hapi/hapi/lib/request.js:280:9)
[2024-10-19 07:18:12.318 -0700] INFO (123): [pubsub] Disconnecting irresponsive client 2122
[2024-10-19 07:46:43.282 -0700] INFO (123): [pubsub] Disconnecting irresponsive client 2123
[2024-10-19 08:47:15.597 -0700] INFO (123): [pubsub] Disconnecting irresponsive client 2124
[2024-10-19 09:18:36.407 -0700] WARN (123): Shelter authorization failed
    err: {
      "type": "Error",
      "message": "Invalid signature time range",
      "stack":
          Error: Invalid signature time range
              at verifyShelterAuthorizationHeader (/home/unpriv/gi/shared/domains/chelonia/utils.js:766:11)
              at Object.authenticate (/home/unpriv/gi/backend/auth.js:43:72)
              at exports.Manager.execute (/home/unpriv/gi/node_modules/@hapi/hapi/lib/toolkit.js:51:36)
              at module.exports.internals.Auth._authenticate (/home/unpriv/gi/node_modules/@hapi/hapi/lib/auth.js:258:58)
              at authenticate (/home/unpriv/gi/node_modules/@hapi/hapi/lib/auth.js:234:21)
              at Request._lifecycle (/home/unpriv/gi/node_modules/@hapi/hapi/lib/request.js:372:68)
              at processTicksAndRejections (node:internal/process/task_queues:95:5)
              at Request._execute (/home/unpriv/gi/node_modules/@hapi/hapi/lib/request.js:280:9)
    }

Solution

I clicked "Mark all as read" multiple times and the same error came up. I was forced to refresh the page.

Perhaps when this error is triggered, we could automatically perform whatever updates are needed without requiring user to refresh page.