fix: fix social adapter bugs, sync docs, refactor boss common utils#204
Merged
fix: fix social adapter bugs, sync docs, refactor boss common utils#204
Conversation
- 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Social Adapter Fixes
data-e2e="undefined-icon"selector →bookmark-icon/collect-iconBoss Refactor
boss/common.tsExtension