Skip to content

fix: fix social adapter bugs, sync docs, refactor boss common utils#204

Merged
jackwener merged 2 commits intomainfrom
feat/boss-common-utils
Mar 21, 2026
Merged

fix: fix social adapter bugs, sync docs, refactor boss common utils#204
jackwener merged 2 commits intomainfrom
feat/boss-common-utils

Conversation

@jackwener
Copy link
Owner

Changes

Social Adapter Fixes

  • TikTok save/unsave: fix broken data-e2e="undefined-icon" selector → bookmark-icon/collect-icon
  • TikTok like/unlike: add state detection to prevent toggling (aria-label + computed color)
  • TikTok notifications: rewrite nested setTimeout to async/await
  • TikTok comment: add post-comment verification
  • Facebook search: URL encode query param, add missing url column
  • Facebook feed: add English locale support for engagement regex
  • Instagram docs: remove 6 non-existent commands
  • Facebook docs: remove 6 non-existent commands

Boss Refactor

  • Extract common utils to boss/common.ts
  • Sanitize numericUid in clickCandidateInList

Extension

  • Rename isDebuggableUrl → isWebUrl, simplify tab selection logic

huangsen365 and others added 2 commits March 21, 2026 23:10
- Add src/clis/boss/common.ts with shared helpers:
  - bossFetch(): unified XHR template with auto cookie-expiry detection (code 7/37)
  - navigateToChat()/navigateTo(): page navigation helpers
  - checkAuth()/assertOk(): centralized login state validation
  - fetchFriendList()/fetchRecommendList()/findFriendByUid(): data queries
  - clickCandidateInList()/typeAndSendMessage(): UI automation helpers
  - verbose(): conditional debug logging

- Refactor all 14 boss adapters to use common.ts:
  - chatlist.ts: was missing cookie-expiry check (fixes #login-detect)
  - chatmsg.ts: was missing cookie-expiry check (fixes #login-detect)
  - Remaining 12 adapters: deduplicated XHR boilerplate and error handling

- Fix execution.ts: skip redundant pre-navigation for TS adapters
  - TS adapters handle their own goto(), pre-navigating caused double
    page loads and could trigger duplicate login prompts
  - Pre-navigation preserved for YAML pipeline commands that need it

Net reduction: ~730 lines of duplicated code across boss adapters.
All 244 unit tests pass.
Instagram:
- Remove 6 non-existent commands from docs (like/unlike/comment/save/unsave/follow/unfollow)
- Fix usage examples to use positional args

Facebook:
- Remove 6 non-existent commands from docs (friends/groups/memories/events/add-friend/join-group)
- Fix search.yaml: URL encode query param, add missing url column
- Fix feed.yaml: add English locale support for engagement regex patterns

TikTok:
- Fix save/unsave: replace broken data-e2e="undefined-icon" with bookmark-icon/collect-icon
- Fix like/unlike: add state detection to prevent toggling (checks aria-label + computed color)
- Fix notifications: rewrite nested setTimeout to async/await
- Fix comment: add post-comment verification, throw on missing post button
@jackwener jackwener merged commit 3669a89 into main Mar 21, 2026
11 checks passed
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