fix #614: fix 5 bugs in profile banner/photo implementation#622
Merged
github-actions[bot] merged 2 commits intomainfrom Mar 24, 2026
Merged
Conversation
- Fix dimension validation catch-all silently swallowing LinkedInBuddyError - Fix hardcoded REMOVE_PROFILE_BANNER_ACTION_TYPE in executeRemoveProfileMedia - Add missing second confirmation dialog handling in banner removal - Add missing dismissOverlays in executeRemoveProfilePhoto - Remove unnecessary async from prepareRemoveBanner (no await)
| Auto-added "Closes #614" to PR body (was missing). |
| 🤖 Auto-merge enabled (squash). Will merge when all required checks pass. |
The dimension validation fix (re-throwing LinkedInBuddyError in catch block) correctly rejects the previous 1x1 test image. Generate a minimal valid PNG meeting the 1584x396 minimum requirement.
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.
Closes #614
Summary
Fixes 5 bugs in the profile banner/photo implementation that were shipped in #616 but left issue #614 open.
Bugs Fixed
1. CRITICAL: Dimension validation is dead code (line 9971)
The
try/catchinprepareUploadBannercatches ALL errors including theLinkedInBuddyErrorthrown when dimensions are too small. The dimension check (≥1584x396) never actually rejects invalid images.Fix: Re-throw
LinkedInBuddyErrorin the catch block — only swallowimageSizeFromFilefailures.2. Hardcoded action type in
executeRemoveProfileMedia(lines 8402, 8415)Always uses
REMOVE_PROFILE_BANNER_ACTION_TYPEregardless of thekindparameter. If called withkind="photo", it would use the wrong action type for rate limiting and logging.Fix: Conditionally select
REMOVE_PROFILE_PHOTO_ACTION_TYPEorREMOVE_PROFILE_BANNER_ACTION_TYPEbased onkind.3. Missing second confirmation dialog in banner removal
executeRemoveProfilePhotohandles a second confirmation dialog that LinkedIn sometimes shows after the initial delete click.executeRemoveProfileMedia(used for banner) does not.Fix: Add the same second confirmation dialog pattern after
clickDeleteInDialog.4. Missing
dismissOverlaysinexecuteRemoveProfilePhotoexecuteRemoveProfileMediapassesdismissOverlaystoexecuteConfirmActionWithArtifactsandnavigateToOwnProfile, butexecuteRemoveProfilePhotodoes not, making it inconsistent and potentially fragile.Fix: Add
dismissOverlaysto both calls inexecuteRemoveProfilePhoto.5. Unnecessary
asynconprepareRemoveBannerprepareRemoveBanneris markedasyncbut contains noawait— unlikeprepareRemovePhotowhich is correctly sync.Fix: Remove
async, change return type fromPromise<PreparedActionResult>toPreparedActionResult.Quality Gates
npm run typecheck— passnpm run lint— cleannpm test— 120 files, 1614 tests passnpm run build— pass