Skip to content

fix #614: fix 5 bugs in profile banner/photo implementation#622

Merged
github-actions[bot] merged 2 commits intomainfrom
ai/issue-614-cover-imagebanner-make-it-production-grade
Mar 24, 2026
Merged

fix #614: fix 5 bugs in profile banner/photo implementation#622
github-actions[bot] merged 2 commits intomainfrom
ai/issue-614-cover-imagebanner-make-it-production-grade

Conversation

@sigvardt
Copy link
Copy Markdown
Owner

@sigvardt sigvardt commented Mar 24, 2026

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/catch in prepareUploadBanner catches ALL errors including the LinkedInBuddyError thrown when dimensions are too small. The dimension check (≥1584x396) never actually rejects invalid images.

Fix: Re-throw LinkedInBuddyError in the catch block — only swallow imageSizeFromFile failures.

2. Hardcoded action type in executeRemoveProfileMedia (lines 8402, 8415)

Always uses REMOVE_PROFILE_BANNER_ACTION_TYPE regardless of the kind parameter. If called with kind="photo", it would use the wrong action type for rate limiting and logging.

Fix: Conditionally select REMOVE_PROFILE_PHOTO_ACTION_TYPE or REMOVE_PROFILE_BANNER_ACTION_TYPE based on kind.

3. Missing second confirmation dialog in banner removal

executeRemoveProfilePhoto handles 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 dismissOverlays in executeRemoveProfilePhoto

executeRemoveProfileMedia passes dismissOverlays to executeConfirmActionWithArtifacts and navigateToOwnProfile, but executeRemoveProfilePhoto does not, making it inconsistent and potentially fragile.

Fix: Add dismissOverlays to both calls in executeRemoveProfilePhoto.

5. Unnecessary async on prepareRemoveBanner

prepareRemoveBanner is marked async but contains no await — unlike prepareRemovePhoto which is correctly sync.

Fix: Remove async, change return type from Promise<PreparedActionResult> to PreparedActionResult.

Quality Gates

  • npm run typecheck — pass
  • npm run lint — clean
  • npm test — 120 files, 1614 tests pass
  • npm run build — pass

- 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)
@github-actions
Copy link
Copy Markdown

Auto-added "Closes #614" to PR body (was missing).

@github-actions github-actions bot enabled auto-merge (squash) March 24, 2026 19:02
@github-actions
Copy link
Copy Markdown

🤖 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.
@github-actions github-actions bot merged commit f60f41f into main Mar 24, 2026
4 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.

Cover image/banner: make it production-grade

1 participant