@lobehub/lobehub 2.0.0-next.300 → 2.0.0-next.301

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/CHANGELOG.md CHANGED
@@ -2,6 +2,31 @@
2
2
 
3
3
  # Changelog
4
4
 
5
+ ## [Version 2.0.0-next.301](https://github.com/lobehub/lobe-chat/compare/v2.0.0-next.300...v2.0.0-next.301)
6
+
7
+ <sup>Released on **2026-01-17**</sup>
8
+
9
+ #### 🐛 Bug Fixes
10
+
11
+ - **desktop**: Ensure allowPrerelease is set correctly for updater.
12
+
13
+ <br/>
14
+
15
+ <details>
16
+ <summary><kbd>Improvements and Fixes</kbd></summary>
17
+
18
+ #### What's fixed
19
+
20
+ - **desktop**: Ensure allowPrerelease is set correctly for updater, closes [#11566](https://github.com/lobehub/lobe-chat/issues/11566) ([9383c6b](https://github.com/lobehub/lobe-chat/commit/9383c6b))
21
+
22
+ </details>
23
+
24
+ <div align="right">
25
+
26
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
27
+
28
+ </div>
29
+
5
30
  ## [Version 2.0.0-next.300](https://github.com/lobehub/lobe-chat/compare/v2.0.0-next.299...v2.0.0-next.300)
6
31
 
7
32
  <sup>Released on **2026-01-17**</sup>
@@ -31,7 +31,24 @@ export class BackendProxyProtocolManager {
31
31
  private readonly handledSessions = new WeakSet<Session>();
32
32
  private readonly logger = createLogger('core:BackendProxyProtocolManager');
33
33
 
34
+ /**
35
+ * Debounce timer for authorization required notifications.
36
+ * Prevents multiple rapid 401 responses from triggering duplicate notifications.
37
+ */
38
+ // eslint-disable-next-line no-undef
39
+ private authRequiredDebounceTimer: NodeJS.Timeout | null = null;
40
+ private static readonly AUTH_REQUIRED_DEBOUNCE_MS = 1000;
41
+
34
42
  private notifyAuthorizationRequired() {
43
+ // Debounce: skip if a notification is already scheduled
44
+ if (this.authRequiredDebounceTimer) {
45
+ return;
46
+ }
47
+
48
+ this.authRequiredDebounceTimer = setTimeout(() => {
49
+ this.authRequiredDebounceTimer = null;
50
+ }, BackendProxyProtocolManager.AUTH_REQUIRED_DEBOUNCE_MS);
51
+
35
52
  const allWindows = BrowserWindow.getAllWindows();
36
53
  for (const win of allWindows) {
37
54
  if (!win.isDestroyed()) {
@@ -146,7 +163,12 @@ export class BackendProxyProtocolManager {
146
163
  responseHeaders.set('Access-Control-Allow-Headers', '*');
147
164
  responseHeaders.set('X-Src-Url', rewrittenUrl);
148
165
 
149
- if (!token && upstreamResponse.status === 401) {
166
+ // Handle 401 Unauthorized: notify authorization required regardless of token presence
167
+ // This covers cases where:
168
+ // 1. No token exists
169
+ // 2. Token has expired
170
+ // 3. Token has been revoked server-side
171
+ if (upstreamResponse.status === 401) {
150
172
  this.notifyAuthorizationRequired();
151
173
  }
152
174
 
@@ -104,6 +104,13 @@ export class UpdaterManager {
104
104
 
105
105
  this.checking = true;
106
106
  this.isManualCheck = manual;
107
+
108
+ // Ensure allowPrerelease is correctly set before each check
109
+ // This guards against any internal state reset by electron-updater
110
+ if (!isStableChannel) {
111
+ autoUpdater.allowPrerelease = true;
112
+ }
113
+
107
114
  logger.info(`${manual ? 'Manually checking' : 'Auto checking'} for updates...`);
108
115
 
109
116
  // If manual check, notify renderer process about check start
@@ -340,13 +347,22 @@ export class UpdaterManager {
340
347
  logger.info(`Configuring GitHub provider for ${channel} channel ${reason}`);
341
348
  logger.info(`Channel set to: latest (will look for latest-mac.yml)`);
342
349
 
350
+ // For beta/nightly channels, we need prerelease versions
351
+ const needPrerelease = channel !== 'stable';
352
+
343
353
  autoUpdater.setFeedURL({
344
354
  owner: githubConfig.owner,
345
355
  provider: 'github',
346
356
  repo: githubConfig.repo,
347
357
  });
348
358
 
349
- logger.info(`GitHub update URL configured: ${githubConfig.owner}/${githubConfig.repo}`);
359
+ // Ensure allowPrerelease is set correctly after setFeedURL
360
+ // setFeedURL may reset some internal states
361
+ autoUpdater.allowPrerelease = needPrerelease;
362
+
363
+ logger.info(
364
+ `GitHub update URL configured: ${githubConfig.owner}/${githubConfig.repo}, allowPrerelease=${needPrerelease}`,
365
+ );
350
366
  }
351
367
  }
352
368
 
package/changelog/v1.json CHANGED
@@ -1,4 +1,9 @@
1
1
  [
2
+ {
3
+ "children": {},
4
+ "date": "2026-01-17",
5
+ "version": "2.0.0-next.301"
6
+ },
2
7
  {
3
8
  "children": {
4
9
  "fixes": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/lobehub",
3
- "version": "2.0.0-next.300",
3
+ "version": "2.0.0-next.301",
4
4
  "description": "LobeHub - an open-source,comprehensive AI Agent framework that supports speech synthesis, multimodal, and extensible Function Call plugin system. Supports one-click free deployment of your private ChatGPT/LLM web application.",
5
5
  "keywords": [
6
6
  "framework",