yaver-feedback-react-native 0.7.1 → 0.7.3

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.
@@ -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;
@@ -79,14 +79,19 @@ const YaverMachinePickerScreen = ({ token, currentDeviceId, onPick, onCancel, })
79
79
  };
80
80
  const renderDevice = (device) => {
81
81
  const selected = device.deviceId === currentDeviceId;
82
- // Match the Yaver mobile app: HEARTBEAT_STALE_MS is 90 s. Using
83
- // 60 s here flashed yellow on a single missed agent beat even
84
- // though the Mac was up.
85
- const stale = device.lastHeartbeat > 0 &&
86
- Date.now() - device.lastHeartbeat > 90000;
82
+ // Trust Convex's `isOnline` the backend already gates it on a
83
+ // fresh 90 s heartbeat (see backend/convex/devices.ts
84
+ // deriveIsOnline). Re-checking on the client produced false
85
+ // yellows from phone↔backend clock skew around the 89-90 s mark.
86
+ //
87
+ // `runnerDown` intentionally does NOT flip the dot. That flag
88
+ // tracks whether the AI runner (claude-code, aider, ...) is
89
+ // healthy — a separate concern from "can I reach this machine?"
90
+ // Mobile app surfaces runner issues via a separate badge, not
91
+ // this dot. Picker's job is reachability, nothing more.
87
92
  const healthColor = !device.isOnline
88
93
  ? '#ef4444'
89
- : device.needsAuth || device.runnerDown || stale
94
+ : device.needsAuth
90
95
  ? '#f59e0b'
91
96
  : '#22c55e';
92
97
  return (<react_native_1.TouchableOpacity key={device.deviceId} style={[styles.deviceRow, selected && styles.deviceSelected]} onPress={() => handlePick(device)}>
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://shocking-echidna-394.eu-west-1.convex.site";
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
- exports.DEFAULT_CONVEX_SITE_URL = 'https://shocking-echidna-394.eu-west-1.convex.site';
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.1",
3
+ "version": "0.7.3",
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",
@@ -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();
@@ -72,15 +72,19 @@ export const YaverMachinePickerScreen: React.FC<YaverMachinePickerProps> = ({
72
72
 
73
73
  const renderDevice = (device: RemoteDevice) => {
74
74
  const selected = device.deviceId === currentDeviceId;
75
- // Match the Yaver mobile app: HEARTBEAT_STALE_MS is 90 s. Using
76
- // 60 s here flashed yellow on a single missed agent beat even
77
- // though the Mac was up.
78
- const stale =
79
- device.lastHeartbeat > 0 &&
80
- Date.now() - device.lastHeartbeat > 90_000;
75
+ // Trust Convex's `isOnline` the backend already gates it on a
76
+ // fresh 90 s heartbeat (see backend/convex/devices.ts
77
+ // deriveIsOnline). Re-checking on the client produced false
78
+ // yellows from phone↔backend clock skew around the 89-90 s mark.
79
+ //
80
+ // `runnerDown` intentionally does NOT flip the dot. That flag
81
+ // tracks whether the AI runner (claude-code, aider, ...) is
82
+ // healthy — a separate concern from "can I reach this machine?"
83
+ // Mobile app surfaces runner issues via a separate badge, not
84
+ // this dot. Picker's job is reachability, nothing more.
81
85
  const healthColor = !device.isOnline
82
86
  ? '#ef4444'
83
- : device.needsAuth || device.runnerDown || stale
87
+ : device.needsAuth
84
88
  ? '#f59e0b'
85
89
  : '#22c55e';
86
90
  return (
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://shocking-echidna-394.eu-west-1.convex.site';
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;