Merged
Conversation
And renamed `getAllActiveTreatmentPaywallIds` to `getActiveTreatmentPaywallIds`, and removed the old `getActiveTreatmentPaywallIds`. This means that when someone calls `preloadPaywalls(forPlacements:)`
Replaces the preloading schedule model with a simple prioritizedCampaignId on the config. When set, the SDK preloads the prioritized campaign's paywalls first (with a 5s delay), then preloads the rest. - Remove PaywallPreloading, PreloadingStep, PreloadablePlacement models - Add prioritizedCampaignId to Config - Update ConfigManager.preloadAllPaywalls() to use prioritized campaign - Update tests for new approach Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When switching API keys, the cached config from the old key persists and can cause incorrect test mode activation due to bundleIdConfig mismatch. Store the last-used API key and clear config, enrichment, and test mode caches when it changes. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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 in this pull request
Checklist
CHANGELOG.mdfor any breaking changes, enhancements, or bug fixes.swiftlintin the main directory and fixed any issues.Greptile Summary
This PR adds support for prioritized campaign preloading. When a campaign is marked as prioritized via the
prioritizedCampaignIdfield in the config, its paywalls are preloaded before all other paywalls, with a 5-second delay between the prioritized and general preloading stages to avoid resource contention.Key changes:
prioritizedCampaignIdoptional field toConfigmodel with proper encoding/decodingpreloadAllPaywalls()to check for prioritized campaigns and preload them firstgetActiveTreatmentPaywallIdsby removing unused synchronous variant and updating async method nameThe implementation is clean and leverages existing caching infrastructure to prevent duplicate preloading operations.
Confidence Score: 5/5
Important Files Changed
prioritizedCampaignIdoptional field with proper encoding/decoding - clean implementationprioritizedCampaignIdserialization - excellent test coverageFlowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD A[preloadAllPaywalls called] --> B{prioritizedCampaignId exists?} B -->|Yes| C[Filter triggers by campaign groupId] B -->|No| G[Get all treatment paywall IDs] C --> D[Get treatment paywall IDs for prioritized triggers] D --> E[Remove presented paywall ID] E --> F[Preload prioritized paywalls] F --> F1[Sleep 5 seconds] F1 --> G G --> H[Remove presented paywall ID] H --> I[Preload remaining paywalls] I --> J[End] style F fill:#90EE90 style I fill:#87CEEB style F1 fill:#FFD700Last reviewed commit: fa1332d