{"record":{"id":"19ba3f95b755d4ad","repo":"microsoft/typescript-go","slug":"w-signature-handle-d-not-found-no-registry-for","errorCode":null,"errorMessage":"%w: signature handle %d not found (no registry for project %s)","messagePattern":"%w: signature handle (.+?) not found \\(no registry for project (.+?)\\)","errorType":"validation","errorClass":"ErrClientError","httpStatus":null,"severity":"error","filePath":"internal/api/session.go","lineNumber":294,"sourceCode":"\n\treturn t, nil\n}\n\n// resolveSignatureHandle resolves a signature handle within the project's registry.\nfunc (sd *snapshotData) resolveSignatureHandle(projectID ProjectID, handle SignatureID) (*checker.Signature, error) {\n\tif handle == 0 {\n\t\treturn nil, fmt.Errorf(\"%w: empty signature handle\", ErrClientError)\n\t}\n\tif projectID == \"\" {\n\t\treturn nil, fmt.Errorf(\"%w: empty project ID for signature handle %d\", ErrClientError, handle)\n\t}\n\n\tsd.projectRegistriesMu.RLock()\n\treg := sd.projectRegistries[projectID]\n\tsd.projectRegistriesMu.RUnlock()\n\n\tif reg == nil {\n\t\treturn nil, fmt.Errorf(\"%w: signature handle %d not found (no registry for project %s)\", ErrClientError, handle, projectID)\n\t}\n\n\treg.signatureRegistryMu.RLock()\n\tsig, ok := reg.signatureRegistry[handle]\n\treg.signatureRegistryMu.RUnlock()\n\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"%w: signature handle %d not found in project registry\", ErrClientError, handle)\n\t}\n\n\treturn sig, nil\n}\n\n// newSignatureResponse registers a signature in the project's registry and returns the response.\nfunc (sd *snapshotData) newSignatureResponse(projectID ProjectID, sig *checker.Signature) *SignatureResponse {\n\tif sig == nil {\n\t\treturn nil\n\t}","sourceCodeStart":276,"sourceCodeEnd":312,"githubUrl":"https://github.com/microsoft/typescript-go/blob/1bcfa18d79a3be41772223d5c05dfe4480e614ff/internal/api/session.go#L276-L312","documentation":"resolveSignatureHandle found no projectRegistryData for the ProjectID: \"signature handle N not found (no registry for project P)\". A project's signature registry is created lazily when the first signature is registered in that project within this snapshot, so this error means no signature-producing call has run in that project here - overwhelmingly caused by a wrong or stale ProjectID paired with the handle.","triggerScenarios":"Signature handle sent with a project handle from a different snapshot; signature from project A paired with project B's handle; querying a project that has never returned signatures in this snapshot with a fabricated/foreign signature id.","commonSituations":"Cached {project, signature} pairs surviving an updateSnapshot; cross-project completion/signature-help flows mixing handles; session restart invalidating registries.","solutions":["Re-run the signature query (getSignaturesOfType / getResolvedSignature) in the current snapshot and use the freshly returned handle","Invalidate signature caches on snapshot change or release","Confirm the project handle itself is current for the snapshot"],"exampleFix":"// before\nawait call(\"signatureFollowUp\", { snapshot, project: oldProject, signature: cachedSig }); // no registry\n\n// after\nconst sig = await call(\"getResolvedSignature\", { snapshot, project, file, position });\nif (sig) await call(\"signatureFollowUp\", { snapshot, project, signature: sig.id });","handlingStrategy":"validation","validationCode":"// TS client: validate scope before sending.\nconst key = `${snapshot}:${project}`;\nif (!signatureRegistriesSeen.has(key)) {\n  throw new Error(`no signature registry for ${key}; re-run getResolvedSignature/getSignaturesOfType first`);\n}\nawait call(\"signatureFollowUp\", { snapshot, project, signature });","typeGuard":"const isScopedSignatureHandle = (h: { snapshot: bigint; project: string; id: number }, cur: bigint): boolean =>\n  h.snapshot === cur && h.project.length > 0 && h.id > 0;","tryCatchPattern":null,"preventionTips":["Expire {project, signature} caches whenever the snapshot changes","Never mix a signature id from one project with another project's handle","After 'no registry for project', always re-acquire via getResolvedSignature in the current snapshot"],"tags":["signature-handle","registry","project","snapshot","stale-handle","client-error"],"backgroundTag":null,"analyzedSha":"1bcfa18d79a3be41772223d5c05dfe4480e614ff","analyzedAt":"2026-08-16T02:12:00.115Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}