kingkont 0.20.14 → 0.20.15

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kingkont",
3
- "version": "0.20.14",
3
+ "version": "0.20.15",
4
4
  "description": "KingKont \u00b7 Chatium \u2014 \u043d\u043e\u0434-\u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440 \u0441\u0446\u0435\u043d \u0441 AI-\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0435\u0439 (\u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438/\u0432\u0438\u0434\u0435\u043e/\u0433\u043e\u043b\u043e\u0441/SFX/\u043c\u0443\u0437\u044b\u043a\u0430/\u0442\u0435\u043a\u0441\u0442)",
5
5
  "main": "main.js",
6
6
  "bin": {
package/renderer/board.js CHANGED
@@ -1643,11 +1643,13 @@ async function openShareModal(p) {
1643
1643
  // В Electron location.origin === http://localhost:17893 — кому
1644
1644
  // отправлять такую ссылку? Принимающий открывает в обычном браузере,
1645
1645
  // там приложение живёт на kingkont.ru. В web используем origin.
1646
- // Канонический путь — /static/web.html. /app/spaces/client/index.html
1647
- // остался как auth-aware redirect-stub (для backwards-compat).
1646
+ // Через /app/spaces/client/index.html (auth-aware stub) — он редиректит
1647
+ // на свежую версионированную /static/web-<sha>.html. /static/web.html
1648
+ // напрямую chatium edge-cache намертво держит stale, шарить эту ссылку
1649
+ // нельзя — получатель увидит старую версию.
1648
1650
  const isLocal = /^https?:\/\/(localhost|127\.0\.0\.1)/.test(location.origin);
1649
1651
  const base = isLocal ? 'https://kingkont.ru' : location.origin;
1650
- return base + '/static/web.html#template=' + proj.id;
1652
+ return base + '/app/spaces/client/index.html#template=' + proj.id;
1651
1653
  }
1652
1654
  function render() {
1653
1655
  const isPub = !!proj.isPublic;
@@ -730,12 +730,13 @@
730
730
  body: JSON.stringify({ content, relPath: f.relPath }),
731
731
  });
732
732
  if (!ur.ok) {
733
- if (ur.status === 404) {
734
- // Либо id протух, либо эндпоинт ещё не задеплоен — пробуем create.
735
- textId = null;
736
- } else {
737
- throw new Error(`update text ${f.relPath} failed: ${ur.status}`);
738
- }
733
+ // Любая non-2xx ошибка на UPDATE — текст-id мог протухнуть
734
+ // (запись удалена/очищена через cleanup) или chatium framework
735
+ // вернул 502 из-за временной ошибки. Любой случай → fallback
736
+ // на CREATE (получаем свежий id, сохраняем content). Раньше
737
+ // throw'или на всё кроме 404 юзер видел «502» и save падал.
738
+ console.warn(`[cloudProjects] update text ${f.relPath} (id=${textId}) → ${ur.status} → fallback CREATE`);
739
+ textId = null;
739
740
  }
740
741
  }
741
742
  if (!textId) {
@@ -747,12 +748,11 @@
747
748
  if (cr.ok) {
748
749
  const j = await cr.json();
749
750
  textId = j.id;
750
- } else if (cr.status === 404 || cr.status === 502) {
751
- // Эндпоинт ещё не задеплоен на chatium-стороне → fallback на CDN.
752
- console.warn(`[cloudProjects] /api/project-texts ${cr.status} → fallback на CDN-upload для ${f.relPath}`);
753
- dbPathFailed = true;
754
751
  } else {
755
- throw new Error(`create text ${f.relPath} failed: ${cr.status}`);
752
+ // Любая ошибка CREATE — даём .md уйти через CDN. Не теряем
753
+ // данные юзера из-за временного 502/500 backend'а.
754
+ console.warn(`[cloudProjects] /api/project-texts ${cr.status} → fallback CDN-upload для ${f.relPath}`);
755
+ dbPathFailed = true;
756
756
  }
757
757
  }
758
758
  if (textId) {