Skip to content

支持收藏链接分页导出 - #116

Merged
DGuang21 merged 3 commits into
mainfrom
codex/saved-link-export
Sep 9, 2026
Merged

DGuang21 merged 3 commits into
mainfrom
codex/saved-link-export

Conversation

@wulujia

@wulujia wulujia commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

新增需要登录的 GET /v1/bookmark/export。每页最多返回 500 条收藏及游标,覆盖归档、快捷链接和抓取失败的条目,排除回收站,保留标签来源与独立的已读/归档/加星状态。

查询从会话确定账号,书签和标签均按账号过滤。按收藏 ID 升序读取,首次请求固定 ID 上限;新增条目不进入本次导出,删除不会导致后续页跳项。响应禁止缓存,无数据库迁移。

验证:通过托管后端的 46 项相关测试(其中导出 8 项),包括真实路由的未登录和过期会话、账号隔离、分页增删及页间元数据变化;变更文件 lint 通过。完整后端类型检查仍有 24 条既有错误,导出代码无类型错误。数据库测试使用内存替身,未验证真实账号端到端导出。

合并共享 API 后更新托管后端并先发布接口,再发布网页。

关联 PR:

Labs is a card on the settings page: features still being tried out,
off by default, switch stored server-side per user.

- sr_user_lab_feature (user_id, feature, enabled, created_at, updated_at);
  no row means off. Migration adds the table and its two indexes.
- LabRepo: listByUser / isEnabled / upsert on the Postgres client.
- LabService: registry is an overridable method (empty here so a
  self-hosted build sees no change); status active reads the switch,
  graduated is on for everyone, retired is off for everyone.
  assertUrlAllowed() throws LAB_FEATURE_DISABLED when a URL needs a
  feature the user has not turned on; gatedFeatureForUrl() is the hook a
  hosted backend overrides to say which URLs are gated.
- LAB_FEATURE_DISABLED (400) carries the feature's display name in the
  localized message (zh / en / es), so clients show it as-is.
- GET /v1/user/labs returns { features: [{ key, status, enabled, enabled_at }] }.
- POST /v1/user/setting/enable|disable with key "lab:<feature>" flips
  the switch; UserService takes LabService.
- Regenerated router and DI.

Claude-Session: https://claude.ai/code/session_01Xg119Pyy2B2UQQddrxw5Dv

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
DGuang21
DGuang21 previously approved these changes Sep 9, 2026
@DGuang21
DGuang21 merged commit 22bf944 into main Sep 9, 2026
1 check passed
@DGuang21
DGuang21 deleted the codex/saved-link-export branch September 9, 2026 04:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants