Skip to content

Commit 77c5ddc

Browse files
committed
fix(boxjs): 订阅缓存问题
1 parent 5108edd commit 77c5ddc

File tree

4 files changed

+43
-5
lines changed

4 files changed

+43
-5
lines changed

box/chavy.boxjs.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const $ = new Env('BoxJs')
33
// 为 eval 准备的上下文环境
44
const $eval_env = {}
55

6-
$.version = '0.19.3'
6+
$.version = '0.19.4'
77
$.versionType = 'beta'
88

99
// 发出的请求需要需要 Surge、QuanX 的 rewrite
@@ -926,7 +926,8 @@ function reloadAppSubCache(url) {
926926
const subcaches = getAppSubCaches()
927927
subcaches[url] = $.toObj(resp.body)
928928
subcaches[url].updateTime = new Date()
929-
$.setjson(subcaches, $.KEY_app_subCaches)
929+
// 仅缓存存在 id 的订阅
930+
$.setjson(subcaches.filter(e => !!e.id), $.KEY_app_subCaches)
930931
$.log(`更新订阅, 成功! ${url}`)
931932
} catch (e) {
932933
$.logErr(e)

box/release/box.release.json

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,21 @@
11
{
22
"releases": [
3+
{
4+
"version": "0.19.4",
5+
"tags": ["beta"],
6+
"author": "@GideonSenku",
7+
"msg": "fix(boxjs): 订阅缓存问题",
8+
"notes": [
9+
{
10+
"name": "修复",
11+
"descs": ["脏数据处理,部分订阅已经 404 或者 403,仅缓存有数据的订阅"]
12+
}
13+
]
14+
},
315
{
416
"version": "0.19.3",
517
"tags": ["beta"],
6-
"author": "@chavyleung",
18+
"author": "@GideonSenku",
719
"msg": "fix(boxjs): 首页拖拽数据问题",
820
"notes": [
921
{

box/release/box.release.tf.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,29 @@
11
{
22
"releases": [
3+
{
4+
"version": "0.19.4",
5+
"tags": ["beta"],
6+
"author": "@GideonSenku",
7+
"msg": "fix(boxjs): 订阅缓存问题",
8+
"notes": [
9+
{
10+
"name": "修复",
11+
"descs": ["脏数据处理,部分订阅已经 404 或者 403,仅缓存有数据的订阅"]
12+
}
13+
]
14+
},
15+
{
16+
"version": "0.19.3",
17+
"tags": ["beta"],
18+
"author": "@GideonSenku",
19+
"msg": "fix(boxjs): 首页拖拽数据问题",
20+
"notes": [
21+
{
22+
"name": "修复",
23+
"descs": ["首页拖拽数组数据中会出现 null"]
24+
}
25+
]
26+
},
327
{
428
"version": "0.19.2",
529
"tags": ["beta"],

chavy.box.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const $ = new Env('BoxJs')
33
// 为 eval 准备的上下文环境
44
const $eval_env = {}
55

6-
$.version = '0.19.3'
6+
$.version = '0.19.4'
77
$.versionType = 'beta'
88

99
// 发出的请求需要需要 Surge、QuanX 的 rewrite
@@ -926,7 +926,8 @@ function reloadAppSubCache(url) {
926926
const subcaches = getAppSubCaches()
927927
subcaches[url] = $.toObj(resp.body)
928928
subcaches[url].updateTime = new Date()
929-
$.setjson(subcaches, $.KEY_app_subCaches)
929+
// 仅缓存存在 id 的订阅
930+
$.setjson(subcaches.filter(e => !!e.id), $.KEY_app_subCaches)
930931
$.log(`更新订阅, 成功! ${url}`)
931932
} catch (e) {
932933
$.logErr(e)

0 commit comments

Comments
 (0)