perf(main): reuse normalized bootstrap success inputs
This commit is contained in:
parent
743bef8f30
commit
a0faab56aa
2 changed files with 21 additions and 6 deletions
|
|
@ -315,7 +315,7 @@ import {
|
||||||
extractBootstrapFailureReason,
|
extractBootstrapFailureReason,
|
||||||
extractHeartbeatTimestamp,
|
extractHeartbeatTimestamp,
|
||||||
extractTranscriptMessageText,
|
extractTranscriptMessageText,
|
||||||
getBootstrapTranscriptSuccessSource,
|
getBootstrapTranscriptSuccessSourceFromNormalized,
|
||||||
getCanonicalSendMessageFieldRule,
|
getCanonicalSendMessageFieldRule,
|
||||||
getCanonicalSendMessageToolRule,
|
getCanonicalSendMessageToolRule,
|
||||||
isTaskBoardSnapshotWorkCandidate,
|
isTaskBoardSnapshotWorkCandidate,
|
||||||
|
|
@ -30598,11 +30598,10 @@ export class TeamProvisioningService {
|
||||||
outcome = { kind: 'failure', observedAt: candidate.observedAt, reason };
|
outcome = { kind: 'failure', observedAt: candidate.observedAt, reason };
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
const successSource = getBootstrapTranscriptSuccessSource(
|
const successSource = getBootstrapTranscriptSuccessSourceFromNormalized(
|
||||||
candidate.text,
|
candidate.normalizedText,
|
||||||
teamName,
|
normalizedTeamName,
|
||||||
memberName,
|
normalizedMemberName
|
||||||
candidate.normalizedText
|
|
||||||
);
|
);
|
||||||
if (successSource) {
|
if (successSource) {
|
||||||
outcome = { kind: 'success', observedAt: candidate.observedAt, source: successSource };
|
outcome = { kind: 'success', observedAt: candidate.observedAt, source: successSource };
|
||||||
|
|
|
||||||
|
|
@ -282,6 +282,22 @@ export function getBootstrapTranscriptSuccessSource(
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return getBootstrapTranscriptSuccessSourceFromNormalized(
|
||||||
|
normalizedText,
|
||||||
|
normalizedTeamName,
|
||||||
|
normalizedMemberName
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getBootstrapTranscriptSuccessSourceFromNormalized(
|
||||||
|
normalizedText: string,
|
||||||
|
normalizedTeamName: string,
|
||||||
|
normalizedMemberName: string
|
||||||
|
): BootstrapTranscriptSuccessSource | null {
|
||||||
|
if (!normalizedText || !normalizedTeamName || !normalizedMemberName) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
normalizedText.startsWith(
|
normalizedText.startsWith(
|
||||||
`member briefing for ${normalizedMemberName} on team "${normalizedTeamName}" (${normalizedTeamName}).`
|
`member briefing for ${normalizedMemberName} on team "${normalizedTeamName}" (${normalizedTeamName}).`
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue