fix(orbit): outbox lost-update recovery and session hardening (#1159)

* fix(orbit): harden the guest outbox — recover lost suggestions, avoid a duplicate outbox

Two outbox robustness issues on the poll-based, non-atomic playlist
transport:

- Lost-update: a track a guest appends to its outbox can be wiped by a
  concurrent host sweep-clear before the host recorded it, leaving the
  suggestion lost AND stuck on "waiting on host" forever (it only clears
  once it reaches the host's play queue). The playlist read-modify-write
  can't be made atomic, so recover: re-send a pending suggestion the host
  hasn't recorded (absent from state.queue) past a grace window — the host
  dedupes by (user, trackId), so it's idempotent — and give up + toast past
  a 45s window so the row stops hanging. New pendingResend planner module
  with unit tests; suggest + tick share ensureTrackInOutbox.

- Duplicate outbox: a transient getPlaylists failure at join was swallowed
  to [], so the existing-outbox check missed and a second outbox was
  created. Distinguish "lookup failed" from "genuinely absent" and retry
  once before falling back to create.

New i18n key for the give-up toast across all locales.

* fix(orbit): reject non-http(s) schemes in share invites

normalizeShareServerUrl only prepends http:// when the server string doesn't
already start with "http", so an invite carrying a scheme like httpx:// or
https-phish:// slips through unchanged. Reject anything whose parsed protocol
isn't http(s) at parse time, before the known-server match. Add round-trip
tests covering the accepted and rejected schemes.

* fix(orbit): read exit-modal role fresh to avoid a stale keydown closure

The exit modal's Enter/Escape handler binds once per open (deps [isOpen]) and
closed over the role prop, so a role change while the modal was up would act
on a stale value. Read role from the store inside the action instead, and drop
the now-unused reactive subscription.

* docs(changelog): consolidate Orbit fixes into one block, add 1159
This commit is contained in:
Psychotoxical
2026-06-22 17:32:53 +02:00
committed by GitHub
parent 9b03949f34
commit 78a177b1bc
20 changed files with 292 additions and 44 deletions
+1
View File
@@ -143,6 +143,7 @@ export const orbit = {
settingShuffleNow: 'Jetzt mischen',
toastSuggested: '{{user}} hat „{{title}}" vorgeschlagen',
toastSuggestedMany: '{{count}} neue Vorschläge in der Warteschlange',
toastSuggestLost: 'Deine Suggestion hat den Host womöglich nicht erreicht',
toastShuffled: 'Warteschlange gemischt',
toastJoined: 'Session beigetreten',
toastLoginFirst: 'Erst anmelden, um einer Session beizutreten',
+1
View File
@@ -143,6 +143,7 @@ export const orbit = {
settingShuffleNow: 'Shuffle now',
toastSuggested: '{{user}} suggested "{{title}}"',
toastSuggestedMany: '{{count}} new suggestions in the queue',
toastSuggestLost: 'Your suggestion may not have reached the host',
toastShuffled: 'Queue shuffled',
toastJoined: 'Joined session',
toastLoginFirst: 'Log in before joining a session',
+1
View File
@@ -143,6 +143,7 @@ export const orbit = {
settingShuffleNow: 'Mezclar ahora',
toastSuggested: '{{user}} sugirió "{{title}}"',
toastSuggestedMany: '{{count}} nuevas sugerencias en la cola',
toastSuggestLost: 'Es posible que tu sugerencia no haya llegado al anfitrión',
toastShuffled: 'Cola mezclada',
toastJoined: 'Te has unido a la sesión',
toastLoginFirst: 'Inicia sesión antes de unirte a una sesión',
+1
View File
@@ -143,6 +143,7 @@ export const orbit = {
settingShuffleNow: 'Mélanger maintenant',
toastSuggested: '{{user}} a suggéré « {{title}} »',
toastSuggestedMany: '{{count}} nouvelles suggestions dans la file',
toastSuggestLost: 'Votre suggestion n\'a peut-être pas atteint l\'hôte',
toastShuffled: 'File mélangée',
toastJoined: 'Session rejointe',
toastLoginFirst: 'Connecte-toi avant de rejoindre une session',
+1
View File
@@ -143,6 +143,7 @@ export const orbit = {
settingShuffleNow: 'Keverés most',
toastSuggested: '{{user}} javasolta: „{{title}}"',
toastSuggestedMany: '{{count}} új javaslat a sorban',
toastSuggestLost: 'A javaslatod lehet, hogy nem jutott el a házigazdához',
toastShuffled: 'A sor megkeverve',
toastJoined: 'Csatlakoztál a munkamenethez',
toastLoginFirst: 'Jelentkezz be, mielőtt csatlakozol egy munkamenethez',
+1
View File
@@ -143,6 +143,7 @@ export const orbit = {
settingShuffleNow: '今すぐシャッフル',
toastSuggested: '{{user}} が "{{title}}" を提案しました',
toastSuggestedMany: 'キューに {{count}} 件の新しい提案',
toastSuggestLost: 'あなたの提案がホストに届かなかった可能性があります',
toastShuffled: 'キューをシャッフルしました',
toastJoined: 'セッションに参加しました',
toastLoginFirst: 'セッション参加前にログインしてください',
+1
View File
@@ -143,6 +143,7 @@ export const orbit = {
settingShuffleNow: 'Stokk nå',
toastSuggested: '{{user}} foreslo "{{title}}"',
toastSuggestedMany: '{{count}} nye forslag i køen',
toastSuggestLost: 'Forslaget ditt nådde kanskje ikke verten',
toastShuffled: 'Kø stokket',
toastJoined: 'Ble med i økt',
toastLoginFirst: 'Logg inn før du blir med i en økt',
+1
View File
@@ -143,6 +143,7 @@ export const orbit = {
settingShuffleNow: 'Nu shufflen',
toastSuggested: '{{user}} stelde "{{title}}" voor',
toastSuggestedMany: '{{count}} nieuwe suggesties in de wachtrij',
toastSuggestLost: 'Je suggestie heeft de host mogelijk niet bereikt',
toastShuffled: 'Wachtrij geshuffled',
toastJoined: 'Deelgenomen aan sessie',
toastLoginFirst: 'Log eerst in voordat je aan een sessie deelneemt',
+1
View File
@@ -143,6 +143,7 @@ export const orbit = {
settingShuffleNow: 'Amestecă acum',
toastSuggested: '{{user}} a sugerat "{{title}}"',
toastSuggestedMany: '{{count}} noi sugestii în coadă',
toastSuggestLost: 'Sugestia ta s-ar putea să nu fi ajuns la gazdă',
toastShuffled: 'Coadă amestecată',
toastJoined: 'A intrat în sesiune',
toastLoginFirst: 'Log in before joining a session',
+1
View File
@@ -145,6 +145,7 @@ export const orbit = {
settingShuffleNow: 'Перемешать сейчас',
toastSuggested: '{{user}} предложил «{{title}}»',
toastSuggestedMany: '{{count}} новых предложений в очереди',
toastSuggestLost: 'Возможно, ваше предложение не дошло до хоста',
toastShuffled: 'Очередь перемешана',
toastJoined: 'Присоединился к сессии',
toastLoginFirst: 'Войди, прежде чем присоединяться к сессии',
+1
View File
@@ -143,6 +143,7 @@ export const orbit = {
settingShuffleNow: '立即洗牌',
toastSuggested: '{{user}} 推荐了"{{title}}"',
toastSuggestedMany: '队列中有 {{count}} 个新建议',
toastSuggestLost: '你的建议可能未送达主持人',
toastShuffled: '队列已洗牌',
toastJoined: '已加入会话',
toastLoginFirst: '加入会话前请先登录',