@mundogamernetwork/shared-ui 1.12.0 → 1.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/locales/de.json CHANGED
@@ -58,16 +58,16 @@
58
58
  "edit": "Bearbeiten",
59
59
  "delete": "Löschen"
60
60
  },
61
- "title": "Key Campaigns",
62
- "my_requests": "My Requests",
61
+ "title": "Key-Kampagnen",
62
+ "my_requests": "Meine Anfragen",
63
63
  "calendar_export_label": "Diese Fristen in deinen Kalender übernehmen:",
64
64
  "calendar_export_ics": "Kalender (.ics)",
65
65
  "calendar_export_csv": "Tabelle (.csv)",
66
66
  "calendar_export_busy": "Wird vorbereitet...",
67
67
  "calendar_export_error": "Die Datei konnte nicht erstellt werden. Bitte versuche es erneut.",
68
- "all": "All",
68
+ "all": "Alle",
69
69
  "details": "Details",
70
- "see_campaign": "See campaign",
70
+ "see_campaign": "Kampagne ansehen",
71
71
  "see_content": "See content",
72
72
  "redeem": "Request",
73
73
  "load_more": "Load more",
@@ -58,16 +58,16 @@
58
58
  "edit": "Editar",
59
59
  "delete": "Excluir"
60
60
  },
61
- "title": "Key Campaigns",
62
- "my_requests": "My Requests",
61
+ "title": "Campanhas de Chaves",
62
+ "my_requests": "Minhas Solicitações",
63
63
  "calendar_export_label": "Leve estes prazos para o seu calendário:",
64
64
  "calendar_export_ics": "Calendário (.ics)",
65
65
  "calendar_export_csv": "Planilha (.csv)",
66
66
  "calendar_export_busy": "Preparando...",
67
67
  "calendar_export_error": "Não foi possível gerar o arquivo. Tente novamente.",
68
- "all": "All",
69
- "details": "Details",
70
- "see_campaign": "See campaign",
68
+ "all": "Todas",
69
+ "details": "Detalhes",
70
+ "see_campaign": "Ver Campanha",
71
71
  "see_content": "See content",
72
72
  "redeem": "Request",
73
73
  "load_more": "Load more",
package/locales/ro.json CHANGED
@@ -58,16 +58,16 @@
58
58
  "edit": "Editează",
59
59
  "delete": "Șterge"
60
60
  },
61
- "title": "Key Campaigns",
62
- "my_requests": "My Requests",
61
+ "title": "Campanii de Chei",
62
+ "my_requests": "Solicitările Mele",
63
63
  "calendar_export_label": "Adaugă aceste termene în calendarul tău:",
64
64
  "calendar_export_ics": "Calendar (.ics)",
65
65
  "calendar_export_csv": "Foaie de calcul (.csv)",
66
66
  "calendar_export_busy": "Se pregătește...",
67
67
  "calendar_export_error": "Fișierul nu a putut fi generat. Încearcă din nou.",
68
- "all": "All",
69
- "details": "Details",
70
- "see_campaign": "See campaign",
68
+ "all": "Toate",
69
+ "details": "Detalii",
70
+ "see_campaign": "Vezi Campania",
71
71
  "see_content": "See content",
72
72
  "redeem": "Request",
73
73
  "load_more": "Load more",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mundogamernetwork/shared-ui",
3
- "version": "1.12.0",
3
+ "version": "1.12.1",
4
4
  "description": "Mundo Gamer Network - Shared UI Layer (Nuxt 3)",
5
5
  "type": "module",
6
6
  "main": "./nuxt.config.ts",
@@ -36,6 +36,11 @@ export default defineNuxtPlugin({
36
36
  headers.Authorization = `Bearer ${import.meta.env.VITE_BEARER_TOKEN}`;
37
37
  }
38
38
 
39
+ // Per-channel count of consecutive unauthorized auth attempts, so a channel
40
+ // whose session is gone stops being re-authorized on every reconnect.
41
+ const authFailures = new Map<string, number>();
42
+ const MAX_AUTH_FAILURES = 3;
43
+
39
44
  window.Pusher = Pusher;
40
45
  window.Echo = new Echo({
41
46
  broadcaster: "pusher",
@@ -66,10 +71,51 @@ export default defineNuxtPlugin({
66
71
  },
67
72
  )
68
73
  .then((response) => {
74
+ authFailures.delete(channel.name);
69
75
  callback(false, response.data);
70
76
  })
71
77
  .catch((error) => {
78
+ const status = error?.response?.status;
72
79
  callback(true, error);
80
+
81
+ // 401/403 means the session is gone, not that the
82
+ // request glitched. pusher-js keeps a failed channel
83
+ // in its subscription list and re-subscribes every
84
+ // channel on each reconnect, so the channel asks
85
+ // broadcasting/auth again on every cycle — forever,
86
+ // from a tab nobody is even looking at.
87
+ //
88
+ // Not dropped on the first failure: a token being
89
+ // refreshed can produce one transient 401, and giving
90
+ // up there would silently kill a channel that was
91
+ // about to work. After MAX_AUTH_FAILURES the session
92
+ // is genuinely gone, so the channel is released and
93
+ // the reconnect loop has nothing left to retry.
94
+ if (status !== 401 && status !== 403) {
95
+ return;
96
+ }
97
+
98
+ const failures = (authFailures.get(channel.name) ?? 0) + 1;
99
+ authFailures.set(channel.name, failures);
100
+
101
+ if (failures < MAX_AUTH_FAILURES) {
102
+ return;
103
+ }
104
+
105
+ authFailures.delete(channel.name);
106
+ console.warn(
107
+ `[WebSocket] Dropping ${channel.name} after ${failures} unauthorized auth attempts.`,
108
+ );
109
+
110
+ // Deferred: unsubscribing re-enters pusher-js, and we
111
+ // are still inside its authorize() callback here.
112
+ setTimeout(() => {
113
+ try {
114
+ window.Echo.leaveChannel(channel.name);
115
+ } catch (e) {
116
+ console.error("[WebSocket] Failed to leave channel:", e);
117
+ }
118
+ }, 0);
73
119
  });
74
120
  },
75
121
  };