clay-server 2.34.1-beta.2 → 2.34.1-beta.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.
|
@@ -103,30 +103,12 @@ function onConnected() {
|
|
|
103
103
|
|
|
104
104
|
// Session restore is now server-driven (user-presence.json).
|
|
105
105
|
// Mate DM restore is also server-driven via "restore_mate_dm" message.
|
|
106
|
-
//
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
console.log("[dm-restore] Server did not restore DM, using localStorage fallback:", savedDm);
|
|
113
|
-
openDm(savedDm);
|
|
114
|
-
}
|
|
115
|
-
}, 2000);
|
|
116
|
-
// Cancel fallback if server restores DM first
|
|
117
|
-
var patchedOnce = false;
|
|
118
|
-
var checkRestore = function (evt) {
|
|
119
|
-
try {
|
|
120
|
-
var d = JSON.parse(evt.data);
|
|
121
|
-
if (d.type === "restore_mate_dm" && !patchedOnce) {
|
|
122
|
-
patchedOnce = true;
|
|
123
|
-
clearTimeout(dmFallbackTimer);
|
|
124
|
-
}
|
|
125
|
-
} catch (e) {}
|
|
126
|
-
};
|
|
127
|
-
ws.addEventListener("message", checkRestore);
|
|
128
|
-
setTimeout(function () { ws.removeEventListener("message", checkRestore); }, 3000);
|
|
129
|
-
}
|
|
106
|
+
// Previously there was a 2s localStorage fallback that auto-called
|
|
107
|
+
// openDm(savedDm) on every reconnect. That fallback re-opened stale
|
|
108
|
+
// mate DMs on every refresh / project switch and was the root cause
|
|
109
|
+
// of the skill-install modal popping unprompted. Server-driven restore
|
|
110
|
+
// is authoritative — drop the client-side fallback entirely.
|
|
111
|
+
try { localStorage.removeItem("clay-active-dm"); } catch (e) {}
|
|
130
112
|
// Safety: clear returningFromMateDm after initial messages settle
|
|
131
113
|
if (store.get('returningFromMateDm')) {
|
|
132
114
|
setTimeout(function () {
|
|
@@ -21,7 +21,6 @@ import { closeTerminal } from './terminal.js';
|
|
|
21
21
|
import { openMobileSheet, setMobileSheetMateData } from './sidebar-mobile.js';
|
|
22
22
|
import { getProfileLang } from './profile.js';
|
|
23
23
|
import { isSchedulerOpen, closeScheduler } from './scheduler.js';
|
|
24
|
-
import { requireClayMateInterview } from './app-skills-install.js';
|
|
25
24
|
import { syncResizeHandles } from './sidebar.js';
|
|
26
25
|
|
|
27
26
|
var MATE_ONBOARDING_KEY = "clay-mate-onboarding-shown";
|
|
@@ -77,13 +76,15 @@ export function openDm(targetUserId) {
|
|
|
77
76
|
if (!ws || ws.readyState !== 1) return;
|
|
78
77
|
// Persist DM state for refresh recovery
|
|
79
78
|
try { localStorage.setItem("clay-active-dm", targetUserId); } catch (e) {}
|
|
80
|
-
//
|
|
79
|
+
// Opening an existing mate DM does not require the clay-mate-interview
|
|
80
|
+
// skill — that skill is only used during new mate creation / reshaping.
|
|
81
|
+
// Showing onboarding + gating a skill version check here caused the
|
|
82
|
+
// "Skill Installation Required" modal to pop on every refresh / project
|
|
83
|
+
// switch via the localStorage DM-restore fallback in app-connection.js.
|
|
81
84
|
if (typeof targetUserId === "string" && targetUserId.indexOf("mate_") === 0) {
|
|
82
85
|
showMateOnboarding(function () {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
if (ws2) ws2.send(JSON.stringify({ type: "dm_open", targetUserId: targetUserId }));
|
|
86
|
-
});
|
|
86
|
+
var ws2 = getWs();
|
|
87
|
+
if (ws2) ws2.send(JSON.stringify({ type: "dm_open", targetUserId: targetUserId }));
|
|
87
88
|
});
|
|
88
89
|
return;
|
|
89
90
|
}
|
|
@@ -197,10 +197,14 @@ export function requireSkills(opts, cb) {
|
|
|
197
197
|
.then(function (res) { return res.json(); })
|
|
198
198
|
.then(function (data) {
|
|
199
199
|
var results = data.results || [];
|
|
200
|
+
// Only "missing" skills block the feature. "outdated" skills already
|
|
201
|
+
// function — an available update should not hard-gate with a modal
|
|
202
|
+
// every time a user opens a DM or refreshes the page. Callers can
|
|
203
|
+
// surface outdated versions elsewhere (e.g. settings / notifications).
|
|
200
204
|
var actionable = [];
|
|
201
205
|
for (var i = 0; i < results.length; i++) {
|
|
202
206
|
var r = results[i];
|
|
203
|
-
if (r.status === "missing"
|
|
207
|
+
if (r.status === "missing") {
|
|
204
208
|
var orig = null;
|
|
205
209
|
for (var j = 0; j < opts.skills.length; j++) {
|
|
206
210
|
if (opts.skills[j].name === r.name) { orig = opts.skills[j]; break; }
|