yaver-feedback-react-native 0.7.1 → 0.7.2
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/dist/FeedbackModal.js +10 -0
- package/dist/auth.d.ts +1 -1
- package/dist/auth.js +6 -1
- package/package.json +1 -1
- package/src/FeedbackModal.tsx +10 -0
- package/src/auth.ts +6 -1
package/dist/FeedbackModal.js
CHANGED
|
@@ -93,6 +93,16 @@ const FeedbackModal = () => {
|
|
|
93
93
|
}
|
|
94
94
|
catch (err) {
|
|
95
95
|
const msg = err instanceof Error ? err.message : String(err);
|
|
96
|
+
// 401 / 403 "invalid token" — the cached session is stale
|
|
97
|
+
// (common after a Convex deployment migration). Sign out so
|
|
98
|
+
// the next interaction surfaces the login sheet, then bubble
|
|
99
|
+
// a readable error up to the user.
|
|
100
|
+
const authFailed = /\b(401|403)\b.*invalid token|invalid token|unauthor/i.test(msg);
|
|
101
|
+
if (authFailed) {
|
|
102
|
+
await YaverFeedback_1.YaverFeedback.signOut();
|
|
103
|
+
YaverFeedback_1.YaverFeedback.showLogin();
|
|
104
|
+
throw new Error('Session expired — please sign in again.');
|
|
105
|
+
}
|
|
96
106
|
const transient = /Network request failed|timeout|ECONNREFUSED|Failed to fetch|fetch failed|aborted/i.test(msg);
|
|
97
107
|
if (!transient)
|
|
98
108
|
throw err;
|
package/dist/auth.d.ts
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* Mobile-only. A web equivalent will ship as a separate `yaver-web-feedback`
|
|
16
16
|
* package; do not import this module from a browser bundle.
|
|
17
17
|
*/
|
|
18
|
-
export declare const DEFAULT_CONVEX_SITE_URL = "https://
|
|
18
|
+
export declare const DEFAULT_CONVEX_SITE_URL = "https://perceptive-minnow-557.eu-west-1.convex.site";
|
|
19
19
|
export declare const DEFAULT_WEB_BASE_URL = "https://yaver.io";
|
|
20
20
|
/** Override the Convex site URL + web base (staging vs prod). */
|
|
21
21
|
export declare function configureAuthEndpoints(opts: {
|
package/dist/auth.js
CHANGED
|
@@ -63,7 +63,12 @@ catch {
|
|
|
63
63
|
const TOKEN_KEY = 'yaver_feedback_auth_token';
|
|
64
64
|
const USER_KEY = 'yaver_feedback_user';
|
|
65
65
|
const DEVICE_KEY = 'yaver_feedback_selected_device';
|
|
66
|
-
|
|
66
|
+
// Source of truth: mobile/src/lib/constants.ts → CONVEX_SITE_URL.
|
|
67
|
+
// The yaver-io Convex deployment was migrated from shocking-echidna-394
|
|
68
|
+
// to perceptive-minnow-557; sessions minted against the old deployment
|
|
69
|
+
// don't validate on agents that point at the new one, producing a 403
|
|
70
|
+
// "invalid token" from the agent's authSDK middleware.
|
|
71
|
+
exports.DEFAULT_CONVEX_SITE_URL = 'https://perceptive-minnow-557.eu-west-1.convex.site';
|
|
67
72
|
exports.DEFAULT_WEB_BASE_URL = 'https://yaver.io';
|
|
68
73
|
let convexSiteUrl = exports.DEFAULT_CONVEX_SITE_URL;
|
|
69
74
|
let webBaseUrl = exports.DEFAULT_WEB_BASE_URL;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "yaver-feedback-react-native",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.2",
|
|
4
4
|
"description": "Visual feedback SDK for Yaver — bug reports, screen recording, voice annotations, and local-first developer workflows",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
package/src/FeedbackModal.tsx
CHANGED
|
@@ -103,6 +103,16 @@ export const FeedbackModal: React.FC = () => {
|
|
|
103
103
|
await fn(client);
|
|
104
104
|
} catch (err) {
|
|
105
105
|
const msg = err instanceof Error ? err.message : String(err);
|
|
106
|
+
// 401 / 403 "invalid token" — the cached session is stale
|
|
107
|
+
// (common after a Convex deployment migration). Sign out so
|
|
108
|
+
// the next interaction surfaces the login sheet, then bubble
|
|
109
|
+
// a readable error up to the user.
|
|
110
|
+
const authFailed = /\b(401|403)\b.*invalid token|invalid token|unauthor/i.test(msg);
|
|
111
|
+
if (authFailed) {
|
|
112
|
+
await YaverFeedback.signOut();
|
|
113
|
+
YaverFeedback.showLogin();
|
|
114
|
+
throw new Error('Session expired — please sign in again.');
|
|
115
|
+
}
|
|
106
116
|
const transient = /Network request failed|timeout|ECONNREFUSED|Failed to fetch|fetch failed|aborted/i.test(msg);
|
|
107
117
|
if (!transient) throw err;
|
|
108
118
|
const ok = await YaverFeedback.reconnect();
|
package/src/auth.ts
CHANGED
|
@@ -67,8 +67,13 @@ const TOKEN_KEY = 'yaver_feedback_auth_token';
|
|
|
67
67
|
const USER_KEY = 'yaver_feedback_user';
|
|
68
68
|
const DEVICE_KEY = 'yaver_feedback_selected_device';
|
|
69
69
|
|
|
70
|
+
// Source of truth: mobile/src/lib/constants.ts → CONVEX_SITE_URL.
|
|
71
|
+
// The yaver-io Convex deployment was migrated from shocking-echidna-394
|
|
72
|
+
// to perceptive-minnow-557; sessions minted against the old deployment
|
|
73
|
+
// don't validate on agents that point at the new one, producing a 403
|
|
74
|
+
// "invalid token" from the agent's authSDK middleware.
|
|
70
75
|
export const DEFAULT_CONVEX_SITE_URL =
|
|
71
|
-
'https://
|
|
76
|
+
'https://perceptive-minnow-557.eu-west-1.convex.site';
|
|
72
77
|
export const DEFAULT_WEB_BASE_URL = 'https://yaver.io';
|
|
73
78
|
|
|
74
79
|
let convexSiteUrl = DEFAULT_CONVEX_SITE_URL;
|