Repository navigation
Conversation
What was broken Extension deal details could still omit the shared Work project and its billing history after the earlier PM-6579 fix. Root cause The earlier fix added the Salesforce TC_Connect_Project_Id__c fallback, but an extension without a usable reference still needed a current project account match. Challenges already associate earlier billing accounts with the shared project, including after the project's current account changes. What was changed Preserve current-account and explicit-reference precedence. When neither resolves, use challenges billed to the opportunity's accounts to find a non-deleted project, with the existing updatedAt/id ordering. Retain the opportunity account and load the shared project's full challenge billing history. Update service documentation, the response DTO description, and README. Any added/updated tests Add eight cases covering absent, invalid and unresolved Salesforce references, multiple account/project candidates, deleted/missing projects, and lookup errors. Update existing precedence and no-match assertions. All four core extension regressions fail against the merged previous fix and pass with this change. pnpm lint and pnpm build pass. All 64 focused API tests and all 6 existing Sales modal rendering tests pass. The full unit suite has 502 passed, 3 skipped, and 15 failed; e2e has 73 passed, 29 skipped, and 8 failed. All failing test names match unchanged origin/dev at 47a0577; this change introduces no new failures. The existing failures concern metadata events, JWT handling, event fixtures, and permission checks. The screenshot account is unavailable in dev (404).
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.
What was broken
Extension deal details could still omit the shared Work project and its billing history after PM-6579's previous fix in #54.
Jira was moved to QA Failed on October 18. Its latest comment describes the previous implementation; there is no additional QA diagnosis beyond the original report that extensions must show the same Work project as the first opportunity.
Root cause
The previous fix correctly added the Salesforce
TC_Connect_Project_Id__cfallback. It remained incomplete when that reference was absent, invalid, or pointed to a missing/deleted project: the endpoint ignored challenge billing records linking the extension's account to the shared project. Completed challenges retain earlier accounts after the project's current billing account changes.What was changed
Preserve the existing current-account and Salesforce-reference lookups. When neither resolves, query challenges billed to any of the opportunity's accounts and select a non-deleted project using the existing most-recently-updated/highest-ID ordering.
Retain the opportunity's own billing account and load the resolved project's full challenge billing history. Include all challenge statuses, ignore nonpositive/missing project IDs, and return the existing sanitized 502 on lookup failures. No relationship is inferred from names or customers.
Files modified:
src/api/salesforce/salesforce-opportunity.service.tssrc/api/salesforce/salesforce-opportunity.service.spec.tssrc/api/salesforce/dto/salesforce-opportunity-response.dto.tsREADME.mdNo schema, dependency, or UI changes. If there is no current-account match, usable Salesforce reference, or challenge billing relationship, the project remains null.
Any added/updated tests
Added eight regression cases for absent/invalid/unresolved Salesforce references, multiple accounts/project candidates, missing/deleted projects, and challenge/project lookup failures. Updated existing no-match and precedence assertions. All four core extension regressions fail against the merged previous fix and pass with this change.
Commands run after
nvm usein each project:pnpm install --frozen-lockfile— passed.pnpm lint— passed.pnpm build— passed.pnpm test --runInBand src/api/salesforce src/shared/services/billingAccount.service.spec.ts— 64 passed.yarn test:no-watch --runInBand --runTestsByPath src/apps/sales/src/OpportunityModal.spec.tsx— 6 passed, including the Work challenges link and billing details.pnpm test --runInBand— 502 passed, 3 skipped, 15 failed.pnpm test:e2e --runInBand— 73 passed, 29 skipped, 8 failed.git fetch originandgit diff --check— passed.The full suites do not pass on unchanged
origin/devat47a0577either: 494 unit tests pass with the same 15 failures; e2e has the same 73 passes and 8 failures. Compared Jest JSON results and confirmed identical failing test names. Those existing metadata-event, JWT, event-fixture, and permission-check failures require separate fixes; this change adds no failures.Live reproduction of the screenshot remains unavailable: billing account 80004530 returns 404 from api.topcoder-dev.com using the provided M2M token helper. The API regressions and existing modal rendering tests validate the expected link behavior.