{"record":{"id":"66e20c7d451a0d37","repo":"iflytek/astron-agent","slug":"invite-record-not-found","errorCode":"INVITE_RECORD_NOT_FOUND","errorMessage":"INVITE_RECORD_NOT_FOUND","messagePattern":"INVITE_RECORD_NOT_FOUND","errorType":"error_code","errorClass":"BusinessException","httpStatus":null,"severity":"warning","filePath":"console/backend/hub/src/main/java/com/iflytek/astron/console/hub/service/space/impl/InviteRecordBizServiceImpl.java","lineNumber":407,"sourceCode":"     * Get invitation record by parameter\n     *\n     * @param param Invitation record ID AES encrypted\n     * @return\n     */\n    @Override\n    public InviteRecordVO getRecordByParam(String param) {\n        long id = 0;\n        try {\n            String decrypt = AESUtil.decrypt(param, AES_KEY);\n            assert decrypt != null;\n            id = Long.parseLong(decrypt);\n        } catch (Exception e) {\n            log.error(\"Failed to parse invitation parameters\", e);\n            throw new BusinessException(ResponseEnum.INVITE_PARAMETER_EXCEPTION);\n        }\n        InviteRecordVO vo = inviteRecordService.selectVOById(id);\n        if (vo == null) {\n            throw new BusinessException(ResponseEnum.INVITE_RECORD_NOT_FOUND);\n        }\n        UserInfo inviterUser = userInfoDataService.findByUid(vo.getInviterUid()).orElseThrow();\n        vo.setInviterName(inviterUser.getNickname());\n        vo.setInviterAvatar(inviterUser.getAvatar());\n        if (Objects.equals(InviteRecordTypeEnum.SPACE.getCode(), vo.getType())) {\n            SpaceUser spaceOwner = spaceUserService.getSpaceOwner(vo.getSpaceId());\n            if (spaceOwner != null) {\n                UserInfo ownerUser = userInfoDataService.findByUid(spaceOwner.getUid()).orElseThrow();\n                vo.setOwnerName(ownerUser.getNickname());\n                vo.setOwnerAvatar(ownerUser.getAvatar());\n            }\n            Space space = spaceService.getSpaceById(vo.getSpaceId());\n            if (space != null) {\n                vo.setSpaceName(space.getName());\n                vo.setSpaceAvatar(space.getAvatarUrl());\n                vo.setSpaceDescription(space.getDescription());\n                vo.setIsBelong(spaceUserService.getSpaceUserByUid(vo.getSpaceId(), vo.getInviteeUid()) != null);\n            } else {","sourceCodeStart":389,"sourceCodeEnd":425,"githubUrl":"https://github.com/iflytek/astron-agent/blob/5e758547a83371a5a4b29dadf4ac03e8dd527635/console/backend/hub/src/main/java/com/iflytek/astron/console/hub/service/space/impl/InviteRecordBizServiceImpl.java#L389-L425","documentation":"INVITE_RECORD_NOT_FOUND is thrown by InviteRecordBizServiceImpl.getRecordByParam when the decrypted invitation id does not match any row via inviteRecordService.selectVOById(id). The decryption succeeded but the underlying invitation record no longer exists (or is filtered out by the VO query, e.g. deleted/expired rows).","triggerScenarios":"Calling getRecordByParam with an encrypted param whose id was deleted from the invite record table, an id from another environment/database, or an id filtered by the selectVOById conditions (status/deleted flag).","commonSituations":"Stale invitation links kept in chat history after the invitation was revoked or the records table cleaned up; cross-environment links; expired invitations purged by a retention job.","solutions":["Check the invite_record table for a row with the decrypted id and confirm it is not soft-deleted or filtered by selectVOById conditions","Regenerate the invitation and send a fresh link","Client-side: detect this code and render an 'invitation expired/invalid' page with a path to request a new invite","If invitations should remain resolvable after acceptance, verify the acceptance flow archives rather than deletes records"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// server-side pre-check\nLong id = decryptInviteParam(param);\nif (id != null && inviteRecordService.getById(id) == null) {\n    // show 'invitation no longer valid' without hitting getRecordByParam\n}","typeGuard":null,"tryCatchPattern":"try {\n    InviteRecordVO vo = inviteRecordBizService.getRecordByParam(param);\n} catch (BusinessException e) {\n    if (ResponseEnum.INVITE_RECORD_NOT_FOUND.getCode().equals(e.getCode())) {\n        return renderInvitationExpiredPage();\n    }\n    throw e;\n}","preventionTips":["Use soft-delete/outdating for invitation records instead of hard deletion","Add link expiry metadata so clients can detect stale invites early","Clean up or invalidate invite links when records are purged"],"tags":["java","invitation","record-not-found"],"backgroundTag":"record-not-found","analyzedSha":"5e758547a83371a5a4b29dadf4ac03e8dd527635","analyzedAt":"2026-09-12T08:03:51.356Z","contentChangedAt":"2026-09-12T08:03:51.356Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}