Skip to content

chore: Avoid infinite loop on unexpected errors in notifications worker scheduling - #877

Merged
LouisCAD merged 2 commits into
mainfrom
avoid-infinite-loop-on-unexpected-errors-in-notifications-worker-scheduling
Oct 26, 2026
Merged

LouisCAD merged 2 commits into
mainfrom
avoid-infinite-loop-on-unexpected-errors-in-notifications-worker-scheduling

Conversation

@LouisCAD

Copy link
Copy Markdown
Contributor

No description provided.

… scheduling

Before, a 401 error could lead to a rescheduling loop.
Copilot AI balanced review requested due to automatic review settings October 26, 2026 14:29
@LouisCAD
LouisCAD enabled auto-merge October 26, 2026 14:31
…ssful

This will help the status code getting through when a backend proxy replies with HTML.
@LouisCAD
LouisCAD force-pushed the avoid-infinite-loop-on-unexpected-errors-in-notifications-worker-scheduling branch from 8eeb0f4 to 59443c1 Compare October 26, 2026 14:33
@sonarqubecloud

Copy link
Copy Markdown

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

A missing import blocks compilation, and terminal worker failures prevent subsequent topic changes from triggering registration.

2 open issues
What changed in this PR

This PR aims to prevent repeated notification-registration scheduling after unexpected failures in the shared Android library.

Changes:

  • Distinguish terminal worker failures from successful completion and retryable errors.
  • Stop the scheduling loop when registration work fails.
  • Limit HTTP content-type validation to successful responses.
File Description
Notifications/​Registration/​src/​main/​kotlin/​NotificationsRegistrationManager.kt Stops rescheduling after worker failure.
Notifications/​Registration/​src/​main/​kotlin/​AbstractNotificationsRegistrationWorker.kt Reports terminal failures and exposes completion status.
Network/​Ktor/​src/​main/​kotlin/​CreateHttpClient.kt Skips content-type validation for unsuccessful responses.

Review effort: Balanced

Comment thread Network/Ktor/src/main/kotlin/CreateHttpClient.kt
@LouisCAD
LouisCAD disabled auto-merge October 26, 2026 15:12
@LouisCAD
LouisCAD merged commit 173b4ce into main Oct 26, 2026
9 checks passed
@LouisCAD
LouisCAD deleted the avoid-infinite-loop-on-unexpected-errors-in-notifications-worker-scheduling branch October 26, 2026 15:12
@LouisCAD LouisCAD changed the title chore: Avoid infinite loop on unexpected errors in notifications worker schedulingfix: Avoid infinite loop on unexpected errors in notifications worker scheduling chore: Avoid infinite loop on unexpected errors in notifications worker scheduling Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants