Skip to content

Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure

TypeScript

fix(profile-ui): suppress invalid invitation expiry (R1-L3)

Josué9feef5266220
diff --git a/profile-ui/app/components/__tests__/InvitationClient.reset.test.tsx b/profile-ui/app/components/__tests__/InvitationClient.reset.test.tsx
index 8fabede8a..e2081b5c5 100644
--- a/profile-ui/app/components/__tests__/InvitationClient.reset.test.tsx
+++ b/profile-ui/app/components/__tests__/InvitationClient.reset.test.tsx
@@ -95,6 +95,23 @@ beforeEach(() => {
afterEach(cleanup)
describe('InvitationClient verified password recovery', () => {
+ it('omits the expiry notice when the invitation timestamp is invalid', () => {
+ render(
+ <InvitationClient
+ invitationToken="invalid-expiry-proof"
+ initialInvitation={{
+ ...passwordReset,
+ purpose: 'member_invitation',
+ expiresAt: 'not-a-date',
+ }}
+ initialError=""
+ />
+ )
+
+ expect(screen.queryByText('This invitation will expire in 48 hours.')).toBeNull()
+ expect(screen.queryByText('This invitation will expire in .')).toBeNull()
+ })
+
it('navigates to the authenticated home after reset completes', async () => {
render(
<InvitationClient
diff --git a/profile-ui/app/invitations/[token]/InvitationClient.tsx b/profile-ui/app/invitations/[token]/InvitationClient.tsx
index 93bb7c2cd..a6c030686 100644
--- a/profile-ui/app/invitations/[token]/InvitationClient.tsx
+++ b/profile-ui/app/invitations/[token]/InvitationClient.tsx
@@ -132,9 +132,8 @@ export function InvitationClient({
const expirationText = useMemo(() => {
if (!invitation || invitation.status !== 'pending') return ''
const remaining = formatRemaining(invitation.expiresAt, now)
- return remaining === 'expired'
- ? 'This invitation has expired.'
- : `This invitation will expire in ${remaining}.`
+ if (remaining === 'expired') return 'This invitation has expired.'
+ return remaining ? `This invitation will expire in ${remaining}.` : ''
}, [invitation, now])
const downloadUrl = getEvenfireDownloadUrl()
diff --git a/profile-ui/lib/invitations.ts b/profile-ui/lib/invitations.ts
index 6d190dae3..0a5255611 100644
--- a/profile-ui/lib/invitations.ts
+++ b/profile-ui/lib/invitations.ts
@@ -1,7 +1,7 @@
export function formatRemaining(expiresAt: string, now: number): string {
const target = new Date(expiresAt).getTime()
if (Number.isNaN(target)) {
- return '48 hours'
+ return ''
}
const diffMs = target - now
diff --git a/profile-ui/package-lock.json b/profile-ui/package-lock.json
index d57b859d3..822fe65c8 100644
--- a/profile-ui/package-lock.json
+++ b/profile-ui/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "clerum-profile-ui",
- "version": "0.1.182",
+ "version": "0.1.183",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-profile-ui",
- "version": "0.1.182",
+ "version": "0.1.183",
"dependencies": {
"@clerum/desktop-app-links": "file:../packages/desktop-app-links",
"@clerum/frontend-components": "file:../packages/frontend-components",
diff --git a/profile-ui/package.json b/profile-ui/package.json
index cd2c535b5..9b650279e 100644
--- a/profile-ui/package.json
+++ b/profile-ui/package.json
@@ -1,6 +1,6 @@
{
"name": "clerum-profile-ui",
- "version": "0.1.182",
+ "version": "0.1.183",
"private": true,
"scripts": {
"dev": "next dev",
diff --git a/profile-ui/test/invitations.test.ts b/profile-ui/test/invitations.test.ts
index 6be4e5a75..aae2d70d5 100644
--- a/profile-ui/test/invitations.test.ts
+++ b/profile-ui/test/invitations.test.ts
@@ -15,6 +15,12 @@ test('formatRemaining reports expired invitations', () => {
assert.equal(formatRemaining('2026-04-20T11:59:59.000Z', now), 'expired')
})
+test('formatRemaining does not invent an expiry for an invalid timestamp', () => {
+ const now = Date.parse('2026-04-20T12:00:00.000Z')
+
+ assert.equal(formatRemaining('not-a-date', now), '')
+})
+
test('buildInvitationHeading includes the team name', () => {
assert.equal(buildInvitationHeading('marketing'), 'Join marketing team')
assert.equal(buildInvitationHeading(undefined), 'Join Evenfire')