• Townie
    AI
  • Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
drewmcdonald

drewmcdonald

inbox

Public
Like
inbox
Home
Code
11
.vtignore
AttachmentService.ts
CLAUDE.md
InboxService.ts
PROJECT.md
TODO.md
auth.ts
db.ts
deno.json
E
emailHandler.ts
H
httpHandler.ts
Branches
1
Pull requests
Remixes
History
Environment variables
2
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
TODO.md
Code
/
TODO.md
Search
…
TODO.md

TODO

High Priority

Error Handling & Retry

Implement consistent error handling strategy across the codebase:

  • Issue: Email handler catches and sends error emails (inconsistent with "fail fast" philosophy)
  • Decision needed: Should we retry on transient failures (SQLite lock, network issues)?
  • Consider: Dead-letter queue for failed email processing
  • File: emailHandler.ts:29-39

Cleanup Cron Job

The hardDeleteProcessedRecords() function is implemented but never invoked.

  • Action: Create Val.town cron trigger to run cleanup periodically (daily or weekly)
  • Function: InboxService.hardDeleteProcessedRecords() (InboxService.ts:88)
  • Recommendation: Daily cron at low-traffic time

Medium Priority

Attachment Download Endpoint

Current implementation returns attachment metadata. Consider adding direct download capability:

  • Current: GET /:recordId/attachments → returns JSON list of attachments
  • Add option 1: GET /:recordId/attachments/:blobId → download specific attachment
  • Add option 2: GET /attachments/:blobId → direct blob download (simpler)
  • File: httpHandler.ts:30-56

Rate Limiting

Email endpoint could be spammed even with allowlist (minor concern for personal use).

  • Note: Val.town provides some platform-level rate limiting
  • Consider: Application-level throttling for email processing
  • Consider: Max emails per sender per time window

Low Priority

Attachment Array Ordering

attachmentBlobIds array has no guaranteed order preservation.

  • Impact: Low - usually not critical for inbox use case
  • Consider: Add explicit ordering metadata if needed
  • File: InboxService.ts (inboxRecordSchema)

Documentation Updates Needed

After implementing fixes, update the following:

  • PROJECT.md - Update API documentation for GET /:recordId/attachments endpoint
  • PROJECT.md - Document that cleanup requires cron setup (once implemented)
  • CLAUDE.md - Add note about error handling philosophy consistency
FeaturesVersion controlCode intelligenceCLI
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.