Web: productChangeInfo on PurchaseParams.package is dropped before reaching purchases-js, so a plan change creates a second subscription
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 48/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- dart, javascript
Direzione di ricerca
Read lib/web/purchases_flutter_web.dart _purchasePackage and purchases-common.ts purchasePackage / createNativePurchaseParams in purchases-hybrid-common to trace the parameter flow and agree on the web-specific type shape. Add coverage for forwarding productChangeInfo through both layers; done means a web purchase reaches purchases-js with the subscription ID and subscriber token, and the relevant tests pass.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
On web, Purchases.purchase(PurchaseParams.package(pkg, productChangeInfo: …)) silently ignores productChangeInfo. The underlying @revenuecat/purchases-js SDK supports product changes (purchase({ rcPackage, productChangeInfo: { subscriptionId, subscriberToken } }), per https://www.revenuecat.com/docs/web/product-changes), but the parameter is dropped twice before it gets there:
purchases_flutterweb plugin —lib/web/purchases_flutter_web.dart,_purchasePackageforwards onlypackageIdentifier,presentedOfferingContextandcustomerEmail(10.19.0; unchanged in 11.0.0).purchases-hybrid-commonJS mappings —purchases-js-hybrid-mappings/src/purchases-common.ts,purchasePackage(purchaseParams)accepts onlypackageIdentifier,presentedOfferingContext,optionIdentifier,customerEmail,selectedLocale,defaultLocale, andcreateNativePurchaseParamsnever setsproductChangeInfoon thePurchaseParamsit passes topurchases.purchase(currentmain, after the 20.3.0 release).
So a Flutter web app whose customer holds an active Web Billing subscription and buys a different package gets a second subscription instead of the configured upgrade/downgrade path, even with change paths configured in the dashboard.
Expected
The same productChangeInfo parameter that is already accepted on the Dart side reaches purchases-js, so a product change on web behaves like it does when calling purchases-js directly: upgrades apply immediately with proration, downgrades at the end of the cycle.
The existing Dart type StoreProductChangeInfo is Play-shaped (oldProductIdentifier, prorationMode), so web needs a shape with subscriptionId / productIdentifier + subscriberToken. Either a web variant of the type, or a dedicated web-only field on PurchaseParams, would work.
Steps to reproduce
- Flutter web app on
purchases_flutter10.19.0 (or 11.0.0), configured with a Web Billing (Stripe Billing) API key. - Configure an upgrade path A → B in the RevenueCat dashboard Product Catalog.
- Customer holds an active subscription to A.
- Mint a subscriber token server-side (
POST /v2/projects/{p}/apps/{a}/authenticate) and callPurchases.purchase(PurchaseParams.package(packageB, productChangeInfo: …)). - Observe a new subscription to B is created alongside A; no product change occurs. The dropped parameter is visible in the two functions above.
Environment
purchases_flutter10.19.0 (also checked 11.0.0 source)purchases-hybrid-commonJS mappings at currentmain(20.3.0, 2026-11-02)- Flutter web (CanvasKit), Chrome; Stripe Billing engine
Related
- RevenueCat/purchases-js#182 and RevenueCat/purchases-js#938 track the SDK-level feature, which now exists. This issue is only about the hybrid layers not forwarding it.
Happy to open a PR for the Dart side if the hybrid-common side gets a productChangeInfo field.
- Lingua principale
- Dart
- Stelle
- 722
- Fork
- 220
- Merge medio
- 16h 36m
- PR unite (30g)
- 25
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di RevenueCat/purchases-flutter
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
RevenueCat/purchases-flutter#2048 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
RevenueCat/purchases-flutter#2014 ·
I maintainer di solito rispondono entro 1 giorno
-
Android: build.gradle uses Groovy space-assignment syntax (deprecated in Gradle 9, removed in Gradle 10)Forse già presa @fguillen-tejera l’ha presa 16 giorni fa. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
RevenueCat/purchases-flutter#1973 ·
I maintainer di solito rispondono entro 1 giorno
-
`error: cannot find symbol` after latest `purchases_flutter` and `purchases_ui_flutter` updatesApertabug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 65/100
RevenueCat/purchases-flutter#1907 · 7 commenti · 2 reazioni ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
RevenueCat/purchases-flutter#1883 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di RevenueCat/purchases-flutter
Issue simili
-
BUG: App crashes on iOS when initializing speech-to-text due to missing microphone and speech recognition keys in Info.plistForse già presa @AyushSrivastava1818 l’ha presa oggi. Apertabug enhancement
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 78/100
AOSSIE-Org/Ell-ena#365 · 2 commenti ·
-
feature
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
VeryGoodOpenSource/vgv-ai-flutter-plugin#219 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
cucumber/gherkin#766 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
Anxcye/anx-reader#1024 ·
-
[cloud_functions]: Apple platforms ignore custom domains passed as regionForse già presa @ragavendranbala-TSL l’ha presa oggi. ApertaNeeds Attention platform: ios platform: macos plugin: functions type: bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
firebase/flutterfire#19015 · 2 commenti ·
I maintainer di solito rispondono entro 4 giorni