@tumbaland/frontend-core 1.10.0 → 1.12.0

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.
@@ -27,22 +27,25 @@ const sendBatch = async () => {
27
27
  }
28
28
  }
29
29
  catch (error) {
30
- // Log error without triggering console interception to prevent recursion.
31
- // Must call originalWarn (not console.warn) below console.warn is the
32
- // no-op we're about to install for the duration of this block.
33
- const originalWarn = console.warn;
34
- console.warn = () => { }; // Temporarily disable console.warn
30
+ // Report the failure without it becoming a log of its own. console.warn is
31
+ // usually the interceptor, which captures and queues whatever passes through
32
+ // it; saving a reference to it and swapping in a no-op did not stop that.
33
+ // Each failure then queued one warning plus, in development, one per dropped
34
+ // log, which refilled the batch past BATCH_SIZE and sent again at once. With
35
+ // the endpoint down that never paused and ran the page out of memory.
36
+ // The interceptor still prints while this flag is set; it just captures nothing.
37
+ const wasIntercepting = window._monitoringInterceptingConsole === true;
38
+ window._monitoringInterceptingConsole = true;
35
39
  try {
36
- originalWarn('Failed to send log batch, dropping logs:', error);
37
- // Optional: log failed batch to console in development
40
+ console.warn('Failed to send log batch, dropping logs:', error);
38
41
  if (config.isDevelopment) {
39
42
  batchToSend.forEach(log => {
40
- originalWarn('📝 [DROPPED LOG]:', JSON.stringify(log));
43
+ console.warn('📝 [DROPPED LOG]:', JSON.stringify(log));
41
44
  });
42
45
  }
43
46
  }
44
47
  finally {
45
- console.warn = originalWarn; // Restore original console.warn
48
+ window._monitoringInterceptingConsole = wasIntercepting;
46
49
  }
47
50
  }
48
51
  };
package/dist/types.d.ts CHANGED
@@ -8,6 +8,15 @@ export interface User {
8
8
  roles?: string[];
9
9
  isApproved?: boolean;
10
10
  lastLoginAt?: string;
11
+ /**
12
+ * When the owner asked for the account to be removed, if they have.
13
+ *
14
+ * Served by `/auth/profile`, which is what this type describes. A request and
15
+ * not a removal: the account signs in and works exactly as before while it
16
+ * stands, and an administrator does the deleting by hand. Null once the owner
17
+ * withdraws it.
18
+ */
19
+ deletionRequestedAt?: string | null;
11
20
  }
12
21
  export interface AuthResponse {
13
22
  authenticated: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tumbaland/frontend-core",
3
- "version": "1.10.0",
3
+ "version": "1.12.0",
4
4
  "description": "Shared frontend auth/group/API-client logic for Tumbaland frontends",
5
5
  "author": "Tumbaland",
6
6
  "license": "MIT",