Repository navigation
Conversation
The console now tells pricing-api what each billing person does with a plan proposal, so Qovery staff can see who saw it, who opened Review and who came from the email, and decide whom to recontact. - seen: each display of the Usage page card or the top bar, with where it showed - review_opened: Review from the card, or the proposal link opening the review - email_clicked: the proposal link came from the email (source=email, or no source for emails sent before this change) - the top bar's Review link now carries source=bar - older pricing-api without the events route: falls back to the first-view call The events call goes through the same Axios instance until the SDK publishes it.
|
Qovery can create a Preview Environment for this PR.
This comment has been generated from Qovery AI 🤖.
|
|
View your CI Pipeline Execution ↗ for commit e4b2e81
💡 With Ultracache enabled, Nx Cloud learns each task's file inputs in CI and uses them on later runs. Turn on Ultracache in workspace settings ↗ · Read docs ↗ ☁️ Nx Cloud last updated this comment at |
There was a problem hiding this comment.
3 issues found across 14 files
Confidence score: 3/5
- In
shared-billing-data-access.ts, a 404 fromproposalEventskipsviewProposal, and the outer catch swallows the error, so proposal viewing can fail when the events route is not deployed. Add a fallback toviewProposalfor that case. - In
organization-banners.tsx, navigation builds raw query parameters instead of using TanStack Router’s typedsearchAPI, leaving this route’s search parameters outside its type checks. Usesearch: { proposal: proposal.id, source: 'bar' }and define the route search schema. - In
settings-billing-usage.spec.tsx, the event assertions can run before the fire-and-forget POST is recorded, making the tests flaky. Wrap the expectations at lines 609, 662, and 680 inwaitFor.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="libs/shared/billing/data-access/src/lib/shared-billing-data-access.ts">
<violation number="1" location="libs/shared/billing/data-access/src/lib/shared-billing-data-access.ts:513">
P2: When the events route is not deployed, `proposalEvent` rejects with a 404, but this branch never calls `viewProposal`: `createPricingClient` always supplies `proposalEvent`, and the outer catch only swallows the error. Fall back to `viewProposal` for the `seen` event on the unavailable-route response so legacy first-view tracking remains active.</violation>
</file>
<file name="apps/console/src/app/components/organization-banners/organization-banners.tsx">
<violation number="1" location="apps/console/src/app/components/organization-banners/organization-banners.tsx:41">
P2: This navigation still constructs raw query parameters instead of using TanStack Router’s typed `search` API. Navigate to the usage route with `search: { proposal: proposal.id, source: 'bar' }` and define the route search schema so malformed proposal state is caught consistently.
(Based on your team's feedback about typed router search parameters.) [d7a1bbdb-f2df-4305-a9f8-8ddf61301535]</violation>
</file>
<file name="libs/domains/organizations/feature/src/lib/settings-billing-usage/settings-billing-usage.spec.tsx">
<violation number="1" location="libs/domains/organizations/feature/src/lib/settings-billing-usage/settings-billing-usage.spec.tsx:662">
P2: These assertions can race the fire-and-forget event reports and fail before the adapter records the POST. Wrap the event expectations at lines 609, 662, and 680 in `waitFor` so the tests wait for the request rather than relying on scheduling.</violation>
</file>
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
| if (client.proposalEvent) await client.proposalEvent(organizationId, proposalId, event, source) | ||
| else if (event === 'seen') await client.viewProposal?.(organizationId, proposalId) |
There was a problem hiding this comment.
P2: When the events route is not deployed, proposalEvent rejects with a 404, but this branch never calls viewProposal: createPricingClient always supplies proposalEvent, and the outer catch only swallows the error. Fall back to viewProposal for the seen event on the unavailable-route response so legacy first-view tracking remains active.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At libs/shared/billing/data-access/src/lib/shared-billing-data-access.ts, line 513:
<comment>When the events route is not deployed, `proposalEvent` rejects with a 404, but this branch never calls `viewProposal`: `createPricingClient` always supplies `proposalEvent`, and the outer catch only swallows the error. Fall back to `viewProposal` for the `seen` event on the unavailable-route response so legacy first-view tracking remains active.</comment>
<file context>
@@ -466,3 +499,20 @@ export const billing = createQueryKeys('billing', {
+ source: ProposalSource
+): Promise<void> {
+ try {
+ if (client.proposalEvent) await client.proposalEvent(organizationId, proposalId, event, source)
+ else if (event === 'seen') await client.viewProposal?.(organizationId, proposalId)
+ } catch {
</file context>
| if (client.proposalEvent) await client.proposalEvent(organizationId, proposalId, event, source) | |
| else if (event === 'seen') await client.viewProposal?.(organizationId, proposalId) | |
| if (client.proposalEvent) { | |
| try { | |
| await client.proposalEvent(organizationId, proposalId, event, source) | |
| return | |
| } catch (error) { | |
| if (!(error instanceof BillingError) || error.status !== 404) return | |
| } | |
| } | |
| if (event === 'seen') await client.viewProposal?.(organizationId, proposalId) |
| variant="bar" | ||
| modal={false} | ||
| onReviewProposal={(proposal) => window.location.assign(`${usagePath}?proposal=${proposal.id}`)} | ||
| onReviewProposal={(proposal) => window.location.assign(proposalReviewPath(usagePath, proposal.id))} |
There was a problem hiding this comment.
P2: This navigation still constructs raw query parameters instead of using TanStack Router’s typed search API. Navigate to the usage route with search: { proposal: proposal.id, source: 'bar' } and define the route search schema so malformed proposal state is caught consistently.
(Based on your team's feedback about typed router search parameters.) [d7a1bbdb-f2df-4305-a9f8-8ddf61301535]
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At apps/console/src/app/components/organization-banners/organization-banners.tsx, line 41:
<comment>This navigation still constructs raw query parameters instead of using TanStack Router’s typed `search` API. Navigate to the usage route with `search: { proposal: proposal.id, source: 'bar' }` and define the route search schema so malformed proposal state is caught consistently.
(Based on your team's feedback about typed router search parameters.) [d7a1bbdb-f2df-4305-a9f8-8ddf61301535]</comment>
<file context>
@@ -38,7 +38,7 @@ export function OrganizationBanners() {
variant="bar"
modal={false}
- onReviewProposal={(proposal) => window.location.assign(`${usagePath}?proposal=${proposal.id}`)}
+ onReviewProposal={(proposal) => window.location.assign(proposalReviewPath(usagePath, proposal.id))}
onAction={(offer) => {
const action = offer.content.action
</file context>
| expect(bodyOf(adapter, '/proposals/7/accept')).toEqual([{ dry_run: true }]) | ||
| expect(calledPaths(adapter).filter((path) => path.endsWith('/proposals'))).toHaveLength(1) | ||
| // An email link without a source is the email: the click, then the review opened | ||
| const events = bodyOf(adapter, '/proposals/7/events') as { event: string }[] |
There was a problem hiding this comment.
P2: These assertions can race the fire-and-forget event reports and fail before the adapter records the POST. Wrap the event expectations at lines 609, 662, and 680 in waitFor so the tests wait for the request rather than relying on scheduling.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At libs/domains/organizations/feature/src/lib/settings-billing-usage/settings-billing-usage.spec.tsx, line 662:
<comment>These assertions can race the fire-and-forget event reports and fail before the adapter records the POST. Wrap the event expectations at lines 609, 662, and 680 in `waitFor` so the tests wait for the request rather than relying on scheduling.</comment>
<file context>
@@ -656,6 +658,27 @@ describe('SettingsBillingUsage', () => {
expect(bodyOf(adapter, '/proposals/7/accept')).toEqual([{ dry_run: true }])
expect(calledPaths(adapter).filter((path) => path.endsWith('/proposals'))).toHaveLength(1)
+ // An email link without a source is the email: the click, then the review opened
+ const events = bodyOf(adapter, '/proposals/7/events') as { event: string }[]
+ expect(events.filter((e) => e.event !== 'seen')).toEqual([
+ { event: 'email_clicked', source: 'email' },
</file context>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## staging #3306 +/- ##
===========================================
- Coverage 55.32% 55.32% -0.01%
===========================================
Files 1558 1558
Lines 38331 38344 +13
Branches 12118 12126 +8
===========================================
+ Hits 21206 21213 +7
- Misses 13841 13847 +6
Partials 3284 3284
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Summary
Issue: none (asked by Romaric on 3 Dec 2026)
When Qovery staff send a plan proposal ("The Qovery team suggests Growth…"), they only knew whether someone saw the banner once. They want to know who saw it, who opened Review and who came from the email, to decide whom to recontact. The console now reports what each billing person does with a proposal; pricing-api keeps one line per person and shows it to staff.
cardorbar). pricing-api counts repeats within 30 minutes as one visit.&source=email; a link without a source is treated as the email, since emails already sent have none.&source=bar, so it is not counted as an email click.qovery-pricing-typescript-axios0.1.2. The new types are declared in data-access and the events call (POST /organization/{id}/proposals/{proposalId}/events) goes through the same Axios instance with the user's token. Oncesdk-v0.1.7is published from pricing-api, bump the pin and switch to the generatedproposalEvent.Merge after the pricing-api change is deployed: before that, the events route does not exist there and the reports are dropped (the banner and the review still work).
pricing-api side: gitlab qovery/backend/pricing-api,
docs/INTEGRATION.mdsection 3.4j.Screenshots / Recordings
No visual change in the Console. I have not checked this branch in the running Console app.
Testing
settings-billing-usage.spec.tsx: seen from the card, review opened from the card, the email link reports the click then the review, the top bar link reports a review from the bar,proposalEventis mountedoffers-bar.spec.tsx: the card and the top bar each report a seen with their source, the older view call is not usedutils/paywall-rules.spec.ts: link source parsing, the events a link reports, the top bar review path, the fallback to the first-view call, the request sent with the user's tokenPR Checklist
Summary by cubic
Reports what each billing person does with a plan proposal, so Qovery staff see who saw it, who opened Review and who came from the email. Previously they only knew a proposal was seen once.
Reporting
seenfires each time the Usage page card or top bar shows, with its source; repeats within 30 minutes count as one visit.review_openedfires on the card's Review or when a proposal link opens the review.email_clickedfires when the link came from the email. The email's button now carries&source=email; links without a source count as the email. The top bar's Review link now carries&source=bar.qovery-pricing-typescript-axios0.1.7 is published.Written for commit e4b2e81. Summary will update on new commits.