Skip to content

Add active job expiration (replicate sponsor pattern)#983

Merged
kevmodrome merged 1 commit intostagingfrom
kevmodrome/job-expiry-logic
Feb 3, 2026
Merged

Add active job expiration (replicate sponsor pattern)#983
kevmodrome merged 1 commit intostagingfrom
kevmodrome/job-expiry-logic

Conversation

@kevmodrome
Copy link
Member

Summary

  • Add 'expired' status to content table via migration 023
  • Implement expireOverdueJobs() in ContentService that updates status and syncs Orama search index
  • Call expiration passively from getSidebarJobs() and getHomeData() (same pattern as sponsors)
  • Simplify expiration checks from metadata date comparison to status check

Why

Jobs previously remained status = 'published' forever, filtering only at query time. This fixes the bug where expired jobs appeared on homepage/category pages and introduces active expiration matching the proven sponsor pattern.

Testing

Database migration adds 'expired' constraint and backfills. Type check, lint, and build succeed.

🤖 Generated with Claude Code

Adds 'expired' status to content table. Jobs now automatically transition from 'published' to 'expired' when their expires_at timestamp passes. Passive expiration checks on page loads via getSidebarJobs() and getHomeData(). Fixes bug where expired jobs appeared on homepage/category pages.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
@github-actions
Copy link
Contributor

github-actions bot commented Feb 3, 2026

✅ Unit Test Results

Status: All Tests Passed

Test Summary

  • ✅ Passed: 152
  • ❌ Failed: 0
  • 📊 Total: 152

Coverage

  • 🔧 Functions: 85.88%
  • 📝 Lines: 84.81%

View detailed results

@github-actions
Copy link
Contributor

github-actions bot commented Feb 3, 2026

✅ Playwright Test Results

Status: All Tests Passed

  • ✅ Passed: 292
  • ❌ Failed: 0
  • 📊 Total: 292

View detailed HTML report

@kevmodrome kevmodrome merged commit cf898e1 into staging Feb 3, 2026
2 checks passed
@kevmodrome kevmodrome deleted the kevmodrome/job-expiry-logic branch February 3, 2026 21:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant