Skip to content

chore: fix oxlint errors - #309

Merged
roitium merged 8 commits into
devfrom
chore/fix-oxlint-errors
Aug 12, 2026
Merged

chore: fix oxlint errors#309
roitium merged 8 commits into
devfrom
chore/fix-oxlint-errors

Conversation

@roitium

@roitium roitium commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • 新功能

    • 优化首页、媒体库、播放器、设置及本地歌单页面的交互就绪检测,提升启动体验。
    • 完善应用路由跳转,登录、设置及相关页面导航更加稳定。
  • 问题修复

    • 优化下载任务“全部重试”流程,提升恢复与重试成功率。
    • 改进歌单、歌词、搜索及播放历史数据处理的一致性。
  • 维护

    • 更新代码检查与构建配置,提升应用稳定性。

@safedep

safedep Bot commented Aug 12, 2026

Copy link
Copy Markdown

SafeDep Report Summary

Green Malicious Packages Badge Green Vulnerable Packages Badge Green Risky License Badge

Package Details
Package Malware Vulnerability Risky License Report
icon @oxlint/binding-android-arm-eabi @ 1.78.0
pnpm-lock.yaml
ok icon
ok icon
ok icon
🔗
icon @oxlint/binding-android-arm64 @ 1.78.0
pnpm-lock.yaml
ok icon
ok icon
ok icon
🔗
icon @oxlint/binding-darwin-arm64 @ 1.78.0
pnpm-lock.yaml
ok icon
ok icon
ok icon
🔗
icon @oxlint/binding-darwin-x64 @ 1.78.0
pnpm-lock.yaml
ok icon
ok icon
ok icon
🔗
icon @oxlint/binding-freebsd-x64 @ 1.78.0
pnpm-lock.yaml
ok icon
ok icon
ok icon
🔗
icon @oxlint/binding-linux-arm-gnueabihf @ 1.78.0
pnpm-lock.yaml
ok icon
ok icon
ok icon
🔗
icon @oxlint/binding-linux-arm-musleabihf @ 1.78.0
pnpm-lock.yaml
ok icon
ok icon
ok icon
🔗
icon @oxlint/binding-linux-arm64-gnu @ 1.78.0
pnpm-lock.yaml
ok icon
ok icon
ok icon
🔗
icon @oxlint/binding-linux-arm64-musl @ 1.78.0
pnpm-lock.yaml
ok icon
ok icon
ok icon
🔗
icon @oxlint/binding-linux-ppc64-gnu @ 1.78.0
pnpm-lock.yaml
ok icon
ok icon
ok icon
🔗
icon @oxlint/binding-linux-riscv64-gnu @ 1.78.0
pnpm-lock.yaml
ok icon
ok icon
ok icon
🔗
icon @oxlint/binding-linux-riscv64-musl @ 1.78.0
pnpm-lock.yaml
ok icon
ok icon
ok icon
🔗
icon @oxlint/binding-linux-s390x-gnu @ 1.78.0
pnpm-lock.yaml
ok icon
ok icon
ok icon
🔗
icon @oxlint/binding-linux-x64-gnu @ 1.78.0
pnpm-lock.yaml
ok icon
ok icon
ok icon
🔗
icon @oxlint/binding-linux-x64-musl @ 1.78.0
pnpm-lock.yaml
ok icon
ok icon
ok icon
🔗
icon @oxlint/binding-openharmony-arm64 @ 1.78.0
pnpm-lock.yaml
ok icon
ok icon
ok icon
🔗
icon @oxlint/binding-win32-arm64-msvc @ 1.78.0
pnpm-lock.yaml
ok icon
ok icon
ok icon
🔗
icon @oxlint/binding-win32-ia32-msvc @ 1.78.0
pnpm-lock.yaml
ok icon
ok icon
ok icon
🔗
icon @oxlint/binding-win32-x64-msvc @ 1.78.0
pnpm-lock.yaml
ok icon
ok icon
ok icon
🔗
icon oxlint @ 1.78.0
packages/expo-wavy-slider/package.json pnpm-lock.yaml
ok icon
ok icon
ok icon
🔗

View complete scan results →

This report is generated by SafeDep Github App

@vercel

vercel Bot commented Aug 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
bbplayer-docs Ready Ready Preview Aug 12, 2026 2:59am

@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 713d178c-e693-46d4-b154-a77b4ed19763

📥 Commits

Reviewing files that changed from the base of the PR and between 96103f9 and 2edd4c6.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (3)
  • apps/mobile/src/app/settings/account.tsx
  • apps/mobile/src/components/modals/playlist/EnableSharingModal.tsx
  • packages/expo-wavy-slider/package.json

Walkthrough

本次变更接入 expo-observe 页面交互观测,移除多处不必要的类型断言,整理 API、数据库和服务实例命名,并更新 Oxlint、TypeScript 构建配置及少量播放列表流程。

Changes

移动端运行时与类型整理

Layer / File(s) Summary
页面观测与导航
apps/mobile/src/app/..., apps/mobile/src/features/library/..., apps/mobile/src/lib/config/queryClient.ts
应用配置 expo-observe。多个页面在挂载后调用 markInteractive()。路由跳转移除 as never 类型断言。
播放列表与播放器流程
apps/mobile/src/app/download.tsx, apps/mobile/src/app/playlist/..., apps/mobile/src/components/..., apps/mobile/src/features/..., apps/mobile/src/hooks/...
重构全部下载重试流程。整理播放器播放暂停、播放列表选择、搜索建议、歌词状态和模态框关闭逻辑。
API、服务与同步实例
apps/backend/src/routes/playlists.ts, apps/mobile/src/lib/api/..., apps/mobile/src/lib/facades/..., apps/mobile/src/lib/services/...
统一 API、数据库和服务实例别名。调整同步 facade 注入。收紧 Bilibili 二维码登录状态类型。移除部分数值转换。
错误处理、lint 与构建配置
apps/mobile/src/lib/player/PlayerSideEffects.ts, apps/mobile/src/utils/..., oxlint.config.mts, eslint.config.mjs, packages/*
更新错误变量命名和错误对象构造。将 Oxlint 配置改为 TypeScript 配置。为多个包补充 rootDir 和行级 lint 例外。

Estimated code review effort: 3 (Moderate) | ~25 minutes

Poem

我是小兔,蹦过代码田,
观测页面亮起来,
路由断言悄悄离开,
服务别名排成行,
lint 规则收进篮,
播放与同步更清爽。

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 3.85% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 标题“chore: fix oxlint errors”准确概括了本次主要变更:修复 Oxlint 检查问题并调整相关配置。
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/fix-oxlint-errors

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@roitium
roitium merged commit 8dc32e2 into dev Aug 12, 2026
8 of 9 checks passed
@roitium
roitium deleted the chore/fix-oxlint-errors branch August 12, 2026 03:02

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🧹 Nitpick comments (1)
apps/mobile/src/hooks/queries/lyrics/index.ts (1)

22-22: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

请使用稳定的歌词输入构造查询键。

完整 track 对象包含 updatedAtcreatedAt、artist 和来源元数据。任意与歌词无关的字段变化都会创建新的 React Query 缓存键,并再次执行 lyricService.smartFetchLyricsstaleTime: 0 会放大重复请求影响。

请先确认 smartFetchLyrics 实际读取的字段,再只把这些字段加入查询键。不要直接放入完整 track 对象。

依据 apps/mobile/src/lib/services/trackService.ts 提供的 Track 字段结构,以及本文件的 staleTime: 0 配置。

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/mobile/src/hooks/queries/lyrics/index.ts` at line 22, Update the
queryKey in the lyrics query using the fields actually read by smartFetchLyrics,
rather than the full track object. Inspect smartFetchLyrics and the Track
structure to include only the stable lyric-relevant inputs, while preserving the
existing lyricsQueryKeys.smartFetchLyrics base key and staleTime behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/backend/src/routes/playlists.ts`:
- Line 143: Update the track_count assignment in the playlist response to
explicitly convert trackCount to a runtime number, using Number(trackCount ??
0), since the TypeScript sql<number> annotation does not alter node-postgres
string results.

In `@apps/mobile/src/features/player/components/lyrics/LyricLineItem.tsx`:
- Around line 149-153: Normalize the value passed to setIsVerbatim in the
LyricLineItem expression to an explicit boolean, preserving the existing
enableVerbatimLyrics, item.isDynamic, item.spans, and currentVal conditions
while ensuring missing spans produce false rather than undefined or null.

In `@apps/mobile/src/lib/facades/syncBilibiliPlaylist.ts`:
- Around line 847-859: 在同步播放列表的保存流程中,将仍引用外层 localPlaylist.value.id
的三处访问统一改为当前事务内 playlistResult.value.id,确保首次同步使用 findOrCreateRemotePlaylist
返回的播放列表 ID,避免访问未初始化的 localPlaylist。

In `@apps/mobile/src/lib/services/playlistService.ts`:
- Line 1275: Update the queries near trackIdSubq and the corresponding query at
the additionally referenced location to use this.db instead of the module-level
defaultDb, preserving the connection bound by PlaylistService.withDB(conn) and
ensuring searchTrackInPlaylist participates in the active transaction.

In `@oxlint.config.mts`:
- Around line 30-31: Remove the broad packages/react-native-bottom-tabs/**
ignore entry from the Oxlint configuration so source files such as SceneMap.tsx
and TabView.tsx are linted. If exclusions are still required, narrow them to
confirmed generated or third-party files only; leave the unrelated
packages/bottom-tabs-react-navigation/** entry unchanged.

---

Nitpick comments:
In `@apps/mobile/src/hooks/queries/lyrics/index.ts`:
- Line 22: Update the queryKey in the lyrics query using the fields actually
read by smartFetchLyrics, rather than the full track object. Inspect
smartFetchLyrics and the Track structure to include only the stable
lyric-relevant inputs, while preserving the existing
lyricsQueryKeys.smartFetchLyrics base key and staleTime behavior.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 0081ee8b-b0ac-4eb6-a6d2-51b24f0997c9

📥 Commits

Reviewing files that changed from the base of the PR and between f41f174 and 96103f9.

📒 Files selected for processing (71)
  • apps/backend/src/routes/playlists.ts
  • apps/mobile/src/app/(tabs)/index.tsx
  • apps/mobile/src/app/(tabs)/library/[tab].tsx
  • apps/mobile/src/app/(tabs)/settings/index.tsx
  • apps/mobile/src/app/_layout.tsx
  • apps/mobile/src/app/download.tsx
  • apps/mobile/src/app/history/[date].tsx
  • apps/mobile/src/app/onboarding.tsx
  • apps/mobile/src/app/player.tsx
  • apps/mobile/src/app/playlist/local/[id].tsx
  • apps/mobile/src/app/playlist/recently/index.tsx
  • apps/mobile/src/app/playlist/remote/collection/[id].tsx
  • apps/mobile/src/app/playlist/remote/favorite/[id].tsx
  • apps/mobile/src/app/playlist/remote/multipage/[bvid].tsx
  • apps/mobile/src/app/playlist/remote/uploader/[mid].tsx
  • apps/mobile/src/app/settings/about.tsx
  • apps/mobile/src/app/settings/bilibili-account/index.tsx
  • apps/mobile/src/app/settings/bilibili-account/qrcode-login.tsx
  • apps/mobile/src/app/share/playlist.tsx
  • apps/mobile/src/components/NowPlayingBar.tsx
  • apps/mobile/src/components/modals/app/UpdateAppModal.tsx
  • apps/mobile/src/components/modals/bilibili/AddVideoToBilibiliFavModal.tsx
  • apps/mobile/src/components/modals/edit-metadata/editPlaylistMetadataModal.tsx
  • apps/mobile/src/components/modals/edit-metadata/editTrackMetadataModal.tsx
  • apps/mobile/src/components/modals/login/CookieLoginModal.tsx
  • apps/mobile/src/components/modals/playlist/BatchAddTracksToLocalPlaylist.tsx
  • apps/mobile/src/components/modals/playlist/CreatePlaylistModal.tsx
  • apps/mobile/src/components/modals/playlist/DuplicateLocalPlaylistModal.tsx
  • apps/mobile/src/components/modals/playlist/FavoriteSyncProgressModal.tsx
  • apps/mobile/src/components/modals/playlist/ManualMatchExternalSync.tsx
  • apps/mobile/src/components/modals/playlist/SyncLocalToBilibiliModal.tsx
  • apps/mobile/src/components/modals/playlist/UpdateTrackLocalPlaylistsModal.tsx
  • apps/mobile/src/features/downloads/DownloadTaskItem.tsx
  • apps/mobile/src/features/home/SearchSuggestions.tsx
  • apps/mobile/src/features/library/shared/TabDisabled.tsx
  • apps/mobile/src/features/player/components/PlayerSlider.tsx
  • apps/mobile/src/features/player/components/lyrics/LyricLineItem.tsx
  • apps/mobile/src/features/playlist/local/components/SyncFailuresSheet.tsx
  • apps/mobile/src/hooks/queries/bilibili/search.ts
  • apps/mobile/src/hooks/queries/lyrics/index.ts
  • apps/mobile/src/hooks/queries/playHistory.ts
  • apps/mobile/src/hooks/stores/useSkinStore.ts
  • apps/mobile/src/lib/api/bilibili/api.ts
  • apps/mobile/src/lib/api/netease/crypto.ts
  • apps/mobile/src/lib/api/netease/request.ts
  • apps/mobile/src/lib/config/queryClient.ts
  • apps/mobile/src/lib/facades/bilibili.ts
  • apps/mobile/src/lib/facades/playlist.ts
  • apps/mobile/src/lib/facades/sharedPlaylist.ts
  • apps/mobile/src/lib/facades/syncBilibiliPlaylist.ts
  • apps/mobile/src/lib/facades/syncExternalPlaylist.ts
  • apps/mobile/src/lib/player/PlayerSideEffects.ts
  • apps/mobile/src/lib/services/artistService.ts
  • apps/mobile/src/lib/services/lyricService.ts
  • apps/mobile/src/lib/services/playlistService.ts
  • apps/mobile/src/lib/services/trackService.ts
  • apps/mobile/src/utils/error-handling.ts
  • apps/mobile/src/utils/log.ts
  • apps/mobile/src/utils/sticky-mitt.ts
  • apps/update-publisher/src/index.ts
  • eslint.config.mjs
  • oxlint.config.mts
  • packages/expo-wavy-slider/src/hooks/useObservableStateAdapter.ts
  • packages/expo-wavy-slider/src/utils/getStateId.ts
  • packages/expo-wavy-slider/src/worklets.fx.ts
  • packages/image-theme-colors/tsconfig.json
  • packages/orpheus/src/hooks/useCurrentTrack.ts
  • packages/orpheus/tsconfig.json
  • packages/react-native-bottom-tabs/src/SceneMap.tsx
  • packages/react-native-bottom-tabs/src/TabView.tsx
  • packages/splash/tsconfig.json

created_at: playlist.createdAt.getTime(),
updated_at: playlist.updatedAt.getTime(),
track_count: Number(trackCount ?? 0),
track_count: trackCount ?? 0,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

rg -n -C 8 'createDb|DATABASE_URL|postgres|neon|sqlite|count\(\*\)' apps/backend/src
rg -n -C 5 '\btrack_count\b' apps/backend/src apps/mobile/src

Repository: bbplayer-app/BBPlayer

Length of output: 25673


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- database connection ---'
cat -n apps/backend/src/db/index.ts

printf '%s\n' '--- backend dependency manifests and lockfile references ---'
git ls-files | grep -E '(^|/)(package\.json|pnpm-lock\.yaml|yarn\.lock|package-lock\.json)$' | sort
rg -n -C 3 '"(pg|postgres|drizzle-orm)"|^  (pg|postgres|drizzle-orm)@|node-postgres' \
  --glob 'package.json' --glob 'pnpm-lock.yaml' --glob 'yarn.lock' --glob 'package-lock.json' .

printf '%s\n' '--- API contract and route implementation ---'
cat -n apps/backend/src/routes/playlists.ts | sed -n '80,150p'
cat -n apps/mobile/src/lib/facades/sharedPlaylist.ts | sed -n '330,375p'

printf '%s\n' '--- read-only static invariant check ---'
python3 - <<'PY'
from pathlib import Path
route = Path("apps/backend/src/routes/playlists.ts").read_text()
db = Path("apps/backend/src/db/index.ts").read_text()
mobile = Path("apps/mobile/src/lib/facades/sharedPlaylist.ts").read_text()
print("uses_node_postgres:", "drizzle-orm/node-postgres" in db)
print("configures_pg_type_parser:", "setTypeParser" in db or "types:" in db)
print("count_expression_is_typed_only:", "sql<number>`count(*)`" in route)
print("track_count_is_explicitly_coerced:", "track_count: Number(trackCount ?? 0)" in route)
print("mobile_contract_requires_number:", "track_count: number" in mobile)
PY

Repository: bbplayer-app/BBPlayer

Length of output: 9990


track_count 转换为数值。

createDb 使用 node-postgres,且未配置 count(*) 的数值解析。sql<number> 只提供 TypeScript 类型,不转换运行时值。pg 默认将 PostgreSQL count(*)int8 结果返回为字符串,导致接口违反 track_count: number 契约。保留 Number(trackCount ?? 0),或配置显式数据库映射。

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/backend/src/routes/playlists.ts` at line 143, Update the track_count
assignment in the playlist response to explicitly convert trackCount to a
runtime number, using Number(trackCount ?? 0), since the TypeScript sql<number>
annotation does not alter node-postgres string results.

Comment on lines +149 to +153
enableVerbatimLyrics &&
item.isDynamic &&
item.spans &&
item.spans.length > 0 &&
currentVal === index
),
currentVal === index,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

setIsVerbatim 的参数归一化为布尔值。

enableVerbatimLyricsitem.isDynamic 为真、但 item.spans 缺失时,当前表达式会产生 undefinednullscheduleOnRN 会把该值传给 setIsVerbatim,使 isVerbatim 状态保存非布尔值。请保留布尔归一化。

建议修改
-				enableVerbatimLyrics &&
-					item.isDynamic &&
-					item.spans &&
-					item.spans.length > 0 &&
-					currentVal === index,
+				Boolean(
+					enableVerbatimLyrics &&
+						item.isDynamic &&
+						item.spans?.length &&
+						currentVal === index,
+				),
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
enableVerbatimLyrics &&
item.isDynamic &&
item.spans &&
item.spans.length > 0 &&
currentVal === index
),
currentVal === index,
Boolean(
enableVerbatimLyrics &&
item.isDynamic &&
item.spans?.length &&
currentVal === index,
),
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/mobile/src/features/player/components/lyrics/LyricLineItem.tsx` around
lines 149 - 153, Normalize the value passed to setIsVerbatim in the
LyricLineItem expression to an explicit boolean, preserving the existing
enableVerbatimLyrics, item.isDynamic, item.spans, and currentVal conditions
while ensuring missing spans produce false rather than undefined or null.

Comment on lines +847 to +859
const playlistResult = await playlistSvc.findOrCreateRemotePlaylist({
title: bilibiliFavoriteListMetadata.info!.title,
description: bilibiliFavoriteListMetadata.info!.intro,
coverUrl: bilibiliFavoriteListMetadata.info!.cover,
type: 'favorite',
remoteSyncId: favoriteId,
authorId: playlistAuthor.value.id,
})
if (localPlaylist.isErr()) {
throw localPlaylist.error
if (playlistResult.isErr()) {
throw playlistResult.error
}
logger.debug('step 5: 创建 playlist 和其对应的 author 信息完成', {
localPlaylistId: localPlaylist.value.id,
localPlaylistId: playlistResult.value.id,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🔴 Critical | ⚡ Quick win

统一使用事务内创建的播放列表 ID。

变量 playlistResult 替换了事务内原来的 localPlaylist,但 Line [1020]、Line [1029] 和 Line [1038] 仍访问外层的 localPlaylist.value.id。首次同步时,外层 localPlaylist.value 可以为空。保存阶段会触发 undefined.id,新收藏夹无法完成同步。

请将这三处改为 playlistResult.value.id

建议修复
 					const replaceResult = await playlistSvc.replacePlaylistAllTracks(
-						localPlaylist.value.id,
+						playlistResult.value.id,
 						finalOrderedTrackIds,
 					)
@@
 					logger.info('同步收藏夹完成', {
 						remoteId: favoriteId,
-						playlistId: localPlaylist.value.id,
+						playlistId: playlistResult.value.id,
 					})
@@
-					return localPlaylist.value.id
+					return playlistResult.value.id
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/mobile/src/lib/facades/syncBilibiliPlaylist.ts` around lines 847 - 859,
在同步播放列表的保存流程中,将仍引用外层 localPlaylist.value.id 的三处访问统一改为当前事务内
playlistResult.value.id,确保首次同步使用 findOrCreateRemotePlaylist 返回的播放列表 ID,避免访问未初始化的
localPlaylist。

}

const trackIdSubq = db
const trackIdSubq = defaultDb

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

使用实例数据库连接,避免绕过事务。

PlaylistService.withDB(conn) 会创建绑定到 conn 的服务实例。但 Line 1275 和 Line 1287 使用模块级 defaultDb。当 searchTrackInPlaylist 运行在事务实例上时,这两个查询会绕过事务,并可能读取不一致的数据。请改用 this.db

建议修改
-				const trackIdSubq = defaultDb
+				const trackIdSubq = this.db
					.select({ id: schema.tracks.id })

...

-						defaultDb.query.playlistTracks.findMany({
+						this.db.query.playlistTracks.findMany({

Also applies to: 1287-1287

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/mobile/src/lib/services/playlistService.ts` at line 1275, Update the
queries near trackIdSubq and the corresponding query at the additionally
referenced location to use this.db instead of the module-level defaultDb,
preserving the connection bound by PlaylistService.withDB(conn) and ensuring
searchTrackInPlaylist participates in the active transaction.

Comment thread oxlint.config.mts
Comment on lines +30 to +31
"packages/bottom-tabs-react-navigation/**",
"packages/react-native-bottom-tabs/**",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟠 Major | 🏗️ Heavy lift

不要忽略整个维护中的源代码包。

packages/react-native-bottom-tabs/** 包含当前 stack 中修改的 packages/react-native-bottom-tabs/src/SceneMap.tsxpackages/react-native-bottom-tabs/src/TabView.tsx。该目录级忽略会绕过这些文件的全部 Oxlint 规则。这样,生产源代码仍可能存在 Oxlint 错误,但 lint 步骤不会报告这些错误。请删除目录级忽略,或只忽略已确认的生成文件和第三方文件。

建议缩小忽略范围
-		"packages/bottom-tabs-react-navigation/**",
-		"packages/react-native-bottom-tabs/**",
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"packages/bottom-tabs-react-navigation/**",
"packages/react-native-bottom-tabs/**",
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@oxlint.config.mts` around lines 30 - 31, Remove the broad
packages/react-native-bottom-tabs/** ignore entry from the Oxlint configuration
so source files such as SceneMap.tsx and TabView.tsx are linted. If exclusions
are still required, narrow them to confirmed generated or third-party files
only; leave the unrelated packages/bottom-tabs-react-navigation/** entry
unchanged.

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.

1 participant