Skip to content

Commit

Permalink
fix(boxjs): 订阅缓存问题
Browse files Browse the repository at this point in the history
  • Loading branch information
gideonsenku committed Jul 15, 2024
1 parent 5108edd commit 77c5ddc
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 5 deletions.
5 changes: 3 additions & 2 deletions box/chavy.boxjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const $ = new Env('BoxJs')
// 为 eval 准备的上下文环境
const $eval_env = {}

$.version = '0.19.3'
$.version = '0.19.4'
$.versionType = 'beta'

// 发出的请求需要需要 Surge、QuanX 的 rewrite
Expand Down Expand Up @@ -926,7 +926,8 @@ function reloadAppSubCache(url) {
const subcaches = getAppSubCaches()
subcaches[url] = $.toObj(resp.body)
subcaches[url].updateTime = new Date()
$.setjson(subcaches, $.KEY_app_subCaches)
// 仅缓存存在 id 的订阅
$.setjson(subcaches.filter(e => !!e.id), $.KEY_app_subCaches)
$.log(`更新订阅, 成功! ${url}`)
} catch (e) {
$.logErr(e)
Expand Down
14 changes: 13 additions & 1 deletion box/release/box.release.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
{
"releases": [
{
"version": "0.19.4",
"tags": ["beta"],
"author": "@GideonSenku",
"msg": "fix(boxjs): 订阅缓存问题",
"notes": [
{
"name": "修复",
"descs": ["脏数据处理,部分订阅已经 404 或者 403,仅缓存有数据的订阅"]
}
]
},
{
"version": "0.19.3",
"tags": ["beta"],
"author": "@chavyleung",
"author": "@GideonSenku",
"msg": "fix(boxjs): 首页拖拽数据问题",
"notes": [
{
Expand Down
24 changes: 24 additions & 0 deletions box/release/box.release.tf.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
{
"releases": [
{
"version": "0.19.4",
"tags": ["beta"],
"author": "@GideonSenku",
"msg": "fix(boxjs): 订阅缓存问题",
"notes": [
{
"name": "修复",
"descs": ["脏数据处理,部分订阅已经 404 或者 403,仅缓存有数据的订阅"]
}
]
},
{
"version": "0.19.3",
"tags": ["beta"],
"author": "@GideonSenku",
"msg": "fix(boxjs): 首页拖拽数据问题",
"notes": [
{
"name": "修复",
"descs": ["首页拖拽数组数据中会出现 null"]
}
]
},
{
"version": "0.19.2",
"tags": ["beta"],
Expand Down
5 changes: 3 additions & 2 deletions chavy.box.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const $ = new Env('BoxJs')
// 为 eval 准备的上下文环境
const $eval_env = {}

$.version = '0.19.3'
$.version = '0.19.4'
$.versionType = 'beta'

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

0 comments on commit 77c5ddc

Please sign in to comment.