Skip to content

SDK-6049: Fix per-page deep links for auto and manual carousel templates - #62

Open
reshab-code wants to merge 2 commits into
developfrom
task/SDK-6049-fix-carousel-deeplink
Open

SDK-6049: Fix per-page deep links for auto and manual carousel templates#62
reshab-code wants to merge 2 commits into
developfrom
task/SDK-6049-fix-carousel-deeplink

Conversation

@reshab-code

Copy link
Copy Markdown
Contributor

Bug

In pt_carousel and pt_manual_carousel, tapping any page always opened pt_dl1 regardless of which page was visible. Two separate issues caused this.

  • Issue 1 - pt_dl2 and pt_dl3 were never read

CarouselProperties only declared pt_dl1, so the decoder silently dropped the other two links. A single actionUrl derived from pt_dl1 was then assigned to every carousel item at construction time.

  • Issue 2 - async race condition scrambled page order

Image validation calls are async. Results were appended to itemViews as they arrived, meaning the page at index 0 could end up being pt_img2 if it loaded faster than pt_img1, giving it the wrong deep link even if the links had been wired up correctly.

Changes

  • Added pt_dl2 and pt_dl3 to CarouselProperties
  • Each image slot in imageUrls now carries its own resolved deep link as a tuple field, paired at build time before any async work starts
  • Replaced itemViews.append inside async callbacks with a [Int: CTCaptionedImageView] dictionary keyed by index. After all callbacks complete, dispatchGroup.notify assembles itemViews in correct slot order using compactMap, skipping any images that failed to load
  • Extracted resolveDeeplink(_:fallback:) as a private method. If pt_dl2 or pt_dl3 is absent, it falls back to pt_dl1. If pt_dl1 is also absent, tapping fires performNotificationDefaultAction

@shubhambjadhavar

Copy link
Copy Markdown

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@reshab-code reshab-code changed the title Fix per-page deep links for auto and manual carousel templates SDK-6049: Fix per-page deep links for auto and manual carousel templates Aug 23, 2026
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.

3 participants