Repository navigation
fix(billing): keep the mounted payment element across quote refreshes - #17312
comfydesigner wants to merge 15 commits into
Conversation
Co-authored-by: Amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-019ff6af-6736-70ad-8211-5b87f42c225f
Amp-Thread-ID: https://ampcode.com/threads/T-019ff6af-6736-70ad-8211-5b87f42c225f Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-019ff6af-6736-70ad-8211-5b87f42c225f Co-authored-by: Amp <amp@ampcode.com>
The confirm summary now reads like a receipt: a Subtotal row (the plan's period price) above only the user-applied promotion discounts, so the visible math closes — subtotal minus promo rows equals the total due. Plan-commitment discounts leave the ledger and render instead as the struck-through list price beside the headline monthly price, matching the pricing table's presentation. Explanations move into the row label; the value column carries only the amount. An applied promo code now renders as a read-only chip with an inline remove control instead of an editable field. Silently replacing an applied code is no longer expressible: the only way to a new code is removing the current one, and a helper line states the one-code rule. The edit-while-applied handling (Apply/Remove flip) is deleted.
Typing in the promo field invalidates the quote so Pay can't submit against an ambiguous intent, but clearing the field never restored it — the only way back was applying an empty code. Both preview components now remember when their own edit broke a current quote and restore it the moment the field returns to its baseline; a quote invalidated for any other reason stays invalid.
Renders the receipt ledger end to end — slashed list price, Subtotal, promo row with the amount alone in the value column, renewal note, and the applied-code chip with its helper line.
…faces bg-secondary-background on a secondary-background parent renders invisible — the chip takes the same interface-stroke border the promo input carries, legible on both themes. The promo story also gets a taller shell so its added rows fit the demo frame.
A solid tertiary fill reads on both themes without a stroke — the same material the tertiary button beneath it uses — replacing the interface-stroke border treatment.
The chip alone carries the rule — a single fixed code with one remove control already communicates one-at-a-time; the caption restated it.
Applying a promo re-quoted, the quote-keyed element remounted, and everything the customer had typed into the card form vanished. The element already takes amount and currency changes through its update watcher, so the remount never earned its cost — the key now tracks the payment-method configuration, the one thing that genuinely requires a fresh element. The instance-count assertion is deliberately inverted: a refreshed quote keeps one instance, a configuration change makes two.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe payment selector key now uses ChangesPayment selector remount behavior
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to The payment selector remount behavior is covered for both quote refreshes and payment-method configuration changes, with no established merge-blocking risk. Caution Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional.
❌ Failed checks (1 error)
✅ Passed checks (6 passed)
Full details: End-To-End Regression Coverage For FixesExplanation The PR title uses the bug-fix signal
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
🎭 Playwright: ✅ 1794 passed, 0 failed · 7 flaky📊 Browser Reports
🎨 Storybook: ✅ Built — View Storybook📦 Bundle Size
⚡ Performance Report
Absolute values
Raw data{
"timestamp": "2026-09-10T00:27:35.419Z",
"gitSha": "9015f81e85335cb0ebdc02347f315ce26a097329",
"branch": "comfydesigner/payment-element-keep",
"measurements": [
{
"name": "canvas-idle",
"durationMs": 2042.6109999999653,
"styleRecalcs": 10,
"styleRecalcDurationMs": 5.306,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 355.674,
"heapDeltaBytes": 5846120,
"heapUsedBytes": 70290512,
"domNodes": 20,
"jsHeapTotalBytes": 24379392,
"scriptDurationMs": 11.709000000000001,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "canvas-idle",
"durationMs": 2005.8810000000449,
"styleRecalcs": 11,
"styleRecalcDurationMs": 5.351999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 339.08099999999996,
"heapDeltaBytes": 5987016,
"heapUsedBytes": 70635176,
"domNodes": 22,
"jsHeapTotalBytes": 24641536,
"scriptDurationMs": 11.537999999999998,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1694.5480000000543,
"styleRecalcs": 72,
"styleRecalcDurationMs": 20.88,
"layouts": 12,
"layoutDurationMs": 2.54,
"taskDurationMs": 548.2080000000001,
"heapDeltaBytes": 155172,
"heapUsedBytes": 64649496,
"domNodes": 54,
"jsHeapTotalBytes": 25427968,
"scriptDurationMs": 71.176,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1756.5159999999196,
"styleRecalcs": 74,
"styleRecalcDurationMs": 22.957,
"layouts": 12,
"layoutDurationMs": 2.3379999999999996,
"taskDurationMs": 620.608,
"heapDeltaBytes": -13474384,
"heapUsedBytes": 51035296,
"domNodes": -278,
"jsHeapTotalBytes": 24088576,
"scriptDurationMs": 74.298,
"eventListeners": -151,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1684.8679999999376,
"styleRecalcs": 30,
"styleRecalcDurationMs": 11.252999999999998,
"layouts": 6,
"layoutDurationMs": 0.508,
"taskDurationMs": 277.79299999999995,
"heapDeltaBytes": 8751116,
"heapUsedBytes": 73410508,
"domNodes": 79,
"jsHeapTotalBytes": 24379392,
"scriptDurationMs": 14.848,
"eventListeners": 19,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1709.4860000001972,
"styleRecalcs": 32,
"styleRecalcDurationMs": 10.757000000000001,
"layouts": 6,
"layoutDurationMs": 0.4860000000000001,
"taskDurationMs": 260.692,
"heapDeltaBytes": 8565088,
"heapUsedBytes": 73041324,
"domNodes": 78,
"jsHeapTotalBytes": 24641536,
"scriptDurationMs": 13.143999999999998,
"eventListeners": 19,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "dom-widget-clipping",
"durationMs": 476.95599999997285,
"styleRecalcs": 12,
"styleRecalcDurationMs": 5.072,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 270.61899999999997,
"heapDeltaBytes": -11059196,
"heapUsedBytes": 53288580,
"domNodes": 20,
"jsHeapTotalBytes": 24641536,
"scriptDurationMs": 39.708,
"eventListeners": 2,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "dom-widget-clipping",
"durationMs": 460.72000000003754,
"styleRecalcs": 12,
"styleRecalcDurationMs": 5.234000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 262.316,
"heapDeltaBytes": -11519100,
"heapUsedBytes": 52961480,
"domNodes": 20,
"jsHeapTotalBytes": 25427968,
"scriptDurationMs": 36.216,
"eventListeners": 2,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000273
},
{
"name": "large-graph-idle",
"durationMs": 2008.1989999999905,
"styleRecalcs": 10,
"styleRecalcDurationMs": 5.314999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 475.212,
"heapDeltaBytes": 4204468,
"heapUsedBytes": 64189524,
"domNodes": -280,
"jsHeapTotalBytes": 3244032,
"scriptDurationMs": 59.451,
"eventListeners": -179,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "large-graph-idle",
"durationMs": 2009.539000000018,
"styleRecalcs": 8,
"styleRecalcDurationMs": 4.486000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 507.239,
"heapDeltaBytes": 3283024,
"heapUsedBytes": 64312896,
"domNodes": -282,
"jsHeapTotalBytes": 3768320,
"scriptDurationMs": 61.14499999999999,
"eventListeners": -177,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-pan",
"durationMs": 2071.631000000025,
"styleRecalcs": 68,
"styleRecalcDurationMs": 11.729000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 879.065,
"heapDeltaBytes": 3016504,
"heapUsedBytes": 63409184,
"domNodes": -283,
"jsHeapTotalBytes": 2650112,
"scriptDurationMs": 275.68600000000004,
"eventListeners": -147,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66999999999998,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "large-graph-pan",
"durationMs": 2082.622000000015,
"styleRecalcs": 70,
"styleRecalcDurationMs": 10.603000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 827.592,
"heapDeltaBytes": 18557752,
"heapUsedBytes": 81549864,
"domNodes": -280,
"jsHeapTotalBytes": 4222976,
"scriptDurationMs": 249.39299999999997,
"eventListeners": -179,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-zoom",
"durationMs": 3104.756000000066,
"styleRecalcs": 66,
"styleRecalcDurationMs": 14.836,
"layouts": 60,
"layoutDurationMs": 7.905,
"taskDurationMs": 1068.998,
"heapDeltaBytes": -8372608,
"heapUsedBytes": 54000732,
"domNodes": 16,
"jsHeapTotalBytes": 5603328,
"scriptDurationMs": 333.727,
"eventListeners": -178,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-zoom",
"durationMs": 3004.742999999962,
"styleRecalcs": 67,
"styleRecalcDurationMs": 13.395999999999999,
"layouts": 60,
"layoutDurationMs": 6.616,
"taskDurationMs": 990.0579999999999,
"heapDeltaBytes": 21663008,
"heapUsedBytes": 86242064,
"domNodes": 20,
"jsHeapTotalBytes": 7864320,
"scriptDurationMs": 318.087,
"eventListeners": 8,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "minimap-idle",
"durationMs": 2039.3220000000838,
"styleRecalcs": 9,
"styleRecalcDurationMs": 5.4190000000000005,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 495.288,
"heapDeltaBytes": 7186784,
"heapUsedBytes": 68008640,
"domNodes": -282,
"jsHeapTotalBytes": 2719744,
"scriptDurationMs": 64.765,
"eventListeners": -177,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "minimap-idle",
"durationMs": 2008.6859999998978,
"styleRecalcs": 9,
"styleRecalcDurationMs": 4.625000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 457.645,
"heapDeltaBytes": 7793252,
"heapUsedBytes": 68591996,
"domNodes": -282,
"jsHeapTotalBytes": 2981888,
"scriptDurationMs": 54.96799999999999,
"eventListeners": -147,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 449.55099999992854,
"styleRecalcs": 47,
"styleRecalcDurationMs": 6.957000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 275.94800000000004,
"heapDeltaBytes": -11049044,
"heapUsedBytes": 53474156,
"domNodes": 20,
"jsHeapTotalBytes": 25952256,
"scriptDurationMs": 76.684,
"eventListeners": 8,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000273
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 456.51199999997516,
"styleRecalcs": 49,
"styleRecalcDurationMs": 7.958000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 290.188,
"heapDeltaBytes": -10769972,
"heapUsedBytes": 53893872,
"domNodes": 24,
"jsHeapTotalBytes": 26476544,
"scriptDurationMs": 78.166,
"eventListeners": 8,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-idle",
"durationMs": 2001.0640000000421,
"styleRecalcs": 11,
"styleRecalcDurationMs": 5.535,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 363.926,
"heapDeltaBytes": -18808368,
"heapUsedBytes": 45737812,
"domNodes": -3,
"jsHeapTotalBytes": 23040000,
"scriptDurationMs": 10.391,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-idle",
"durationMs": 2006.4530000000786,
"styleRecalcs": 12,
"styleRecalcDurationMs": 5.332,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 315.748,
"heapDeltaBytes": 5928064,
"heapUsedBytes": 70622964,
"domNodes": 24,
"jsHeapTotalBytes": 24641536,
"scriptDurationMs": 10.086,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1717.7110000000084,
"styleRecalcs": 77,
"styleRecalcDurationMs": 23.988000000000003,
"layouts": 16,
"layoutDurationMs": 2.9290000000000003,
"taskDurationMs": 577.299,
"heapDeltaBytes": -17324260,
"heapUsedBytes": 47251704,
"domNodes": -278,
"jsHeapTotalBytes": 23564288,
"scriptDurationMs": 58.051,
"eventListeners": -151,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1706.721000000016,
"styleRecalcs": 76,
"styleRecalcDurationMs": 21.565,
"layouts": 16,
"layoutDurationMs": 2.408,
"taskDurationMs": 547.614,
"heapDeltaBytes": -16653168,
"heapUsedBytes": 47819700,
"domNodes": -276,
"jsHeapTotalBytes": 23564288,
"scriptDurationMs": 54.13300000000001,
"eventListeners": -151,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-transition-enter",
"durationMs": 866.0099999999602,
"styleRecalcs": 20,
"styleRecalcDurationMs": 21.375000000000004,
"layouts": 16,
"layoutDurationMs": 7.818000000000002,
"taskDurationMs": 629.4790000000002,
"heapDeltaBytes": 8473428,
"heapUsedBytes": 100320232,
"domNodes": 13673,
"jsHeapTotalBytes": 12582912,
"scriptDurationMs": 18.598000000000003,
"eventListeners": 2373,
"totalBlockingTimeMs": 82,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "viewport-pan-sweep",
"durationMs": 8136.661000000004,
"styleRecalcs": 250,
"styleRecalcDurationMs": 37.116,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 3289.252,
"heapDeltaBytes": 10310968,
"heapUsedBytes": 70205336,
"domNodes": -278,
"jsHeapTotalBytes": 5533696,
"scriptDurationMs": 959.096,
"eventListeners": -131,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "viewport-pan-sweep",
"durationMs": 8084.359999999833,
"styleRecalcs": 249,
"styleRecalcDurationMs": 30.773999999999997,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 3023.8050000000003,
"heapDeltaBytes": 30521688,
"heapUsedBytes": 90120836,
"domNodes": -280,
"jsHeapTotalBytes": 6582272,
"scriptDurationMs": 907.793,
"eventListeners": -163,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-large-graph-idle",
"durationMs": 11482.844999999998,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 11446.137,
"heapDeltaBytes": -43219360,
"heapUsedBytes": 173465792,
"domNodes": -8312,
"jsHeapTotalBytes": -7278592,
"scriptDurationMs": 427.111,
"eventListeners": -16391,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333326,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-idle",
"durationMs": 10339.897999999948,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 10270.845,
"heapDeltaBytes": -42424484,
"heapUsedBytes": 168297428,
"domNodes": -8312,
"jsHeapTotalBytes": -12521472,
"scriptDurationMs": 336.053,
"eventListeners": -16391,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-large-graph-pan",
"durationMs": 13721.432999999934,
"styleRecalcs": 66,
"styleRecalcDurationMs": 14.221999999999985,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 13672.900000000001,
"heapDeltaBytes": -38760972,
"heapUsedBytes": 173956564,
"domNodes": -8312,
"jsHeapTotalBytes": -13639680,
"scriptDurationMs": 675.9269999999999,
"eventListeners": -16389,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.779999999999927,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-pan",
"durationMs": 13270.743999999922,
"styleRecalcs": 66,
"styleRecalcDurationMs": 13.69300000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 13246.435000000001,
"heapDeltaBytes": -49007288,
"heapUsedBytes": 158109952,
"domNodes": -8312,
"jsHeapTotalBytes": -15142912,
"scriptDurationMs": 664.375,
"eventListeners": -16387,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.219999999999953,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "workflow-execution",
"durationMs": 430.7770000000346,
"styleRecalcs": 16,
"styleRecalcDurationMs": 15.360999999999999,
"layouts": 3,
"layoutDurationMs": 1.04,
"taskDurationMs": 85.754,
"heapDeltaBytes": 5082072,
"heapUsedBytes": 68704184,
"domNodes": 128,
"jsHeapTotalBytes": 4980736,
"scriptDurationMs": 6.851999999999999,
"eventListeners": 99,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.669999999999998,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "workflow-execution",
"durationMs": 428.0430000001161,
"styleRecalcs": 13,
"styleRecalcDurationMs": 11.562,
"layouts": 3,
"layoutDurationMs": 0.517,
"taskDurationMs": 74.502,
"heapDeltaBytes": 5038504,
"heapUsedBytes": 68569248,
"domNodes": 123,
"jsHeapTotalBytes": 4718592,
"scriptDurationMs": 6.585000000000001,
"eventListeners": 99,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000273
}
]
}🔬 E2E Coverage
|
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## comfydesigner/checkout-promo-polish #17312 +/- ##
======================================================================
Coverage ? 81.17%
======================================================================
Files ? 1886
Lines ? 126032
Branches ? 39844
======================================================================
Hits ? 102305
Misses ? 23141
Partials ? 586
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
dante01yoon
left a comment
There was a problem hiding this comment.
Verified that quote id/version refreshes now preserve the mounted Stripe element while payment method configuration changes still force re-initialization. The existing Elements watcher updates amount and currency, and the focused instance-count coverage exercises both lifecycle paths. The failing cloud E2E is in the unrelated checkout timeout/Back-button scenario outside this diff.
The base branch was changed.
|
Re-anchored this on main — the consolidated checkout architecture landed there, so the stack on checkout-promo-polish was obsolete and showing phantom conflicts. Diff is back to the original two files: the stable payment_method_configuration_id key plus the no-remount regression test (22/22 passing on current main). Base branch changed, which dropped the earlier approval — re-requesting. |
christian-byrne
left a comment
There was a problem hiding this comment.
Approving. Reviewing this as part of a sweep that had not been seeing it — our roster only queried PRs authored by one person until today, so a billing fix sitting on the review queue from anyone else was invisible. That is our gap, not yours, and it is fixed.
The premise checks out, and so does the thing that would have made the fix wrong.
The bug is real: keying the element on `${quote_id}:${quote_version}` means any re-quote destroys and recreates it, and a Stripe payment element loses its state on remount. Applying a promo code after typing a card is the exact sequence, and it is the worst one — the customer is doing the thing that saves money and is punished with re-entering a card number.
The risk in the fix is the mirror image: keying more narrowly could miss a change that genuinely needs a fresh element. We checked that rather than assuming, because it is the failure this change could introduce:
// UnifiedStripePaymentSelector.vue:291
watch([() => amountCents, () => currency], ([amount, nextCurrency]) => {
if (!stripeElements.value || amount <= 0) return
stripeElements.value.update({ amount, currency: nextCurrency.toLowerCase() })The watcher covers amount and currency, not amount alone. So the two inputs that change on a re-quote both flow through elements.update, and your description is accurate that the key was defeating a mechanism already built for this. payment_method_configuration_id is left as the key because a different configuration means a different method set, which update cannot express — that is the one case that does need a remount, and it still gets one.
The ?? '' fallback is fine for the same reason: two quotes that both carry no configuration id resolve to the same key and correctly do not remount, since the account default did not change between them.
The blocker here is not your code. reviewDecision is CHANGES_REQUESTED from a CodeRabbit review on 2026-09-17 with zero unresolved threads — the threads were dealt with and the review state was never dismissed. That is the fifth time we have seen that exact shape in this wave (#16082, #17620, #17937, #18042 and now this), and each time the PR was merge-ready and read as blocked.
Nothing outstanding from us. CI clean, +17/−1 across two files, and the test added pins both halves — one quote refresh keeps the instance, a changed configuration replaces it.
Approved.
|
Closing: fixed on main another way. The shared account-ui StripePaymentForm now updates the mounted element in place on re-quote (elements.update), so card details survive a promo. FE-2148 canceled. |
Closes FE-2148. Stacked on #15159 (sibling of #17311 — independent files, either order).
Entering card details and then applying a promo code wiped every payment field: the payment element was keyed on
quote_id:quote_version, so the re-quote forced a full remount and Stripe's element lost its state. The customer re-typed their whole card to save money.What changes
:keytrackspayment_method_configuration_id— the one input that genuinely requires a fresh element (a different configuration means a different method set). Amount and currency changes flow through the element's existingelements.updatewatcher, which was already built for exactly this and was being defeated by the key.v-if="captureMode && quoteReady") is untouched — the premature-mount latch the old key comment worried about is still prevented by the gate, not the key.Tests
┆ Linear: FE-2148