Skip to content

fix: store cost on timeline entries so exporting a timeline works - #291

Merged
Martin-1997 merged 1 commit into
masterfrom
fix/288-timeline-cost
Oct 24, 2026
Merged

Martin-1997 merged 1 commit into
masterfrom
fix/288-timeline-cost

Conversation

@Martin-1997

@Martin-1997 Martin-1997 commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

Exporting a timeline failed with HTTP 500 ("cost is not a valid attribute") whenever the selected range contained time entries: postTimeline() calls TimelineEntry::setCost(), but timeline entries had no cost field or column. The timeline itself was already inserted, so every failed export also left an empty timeline behind.

  • Add a nullable cost column (cents, like work intervals) to timetracker_timeline_entry, and the property on TimelineEntry
  • Create the timeline and its entries in one transaction, so a failing entry doesn't leave an empty timeline
  • Include the cost and the total cost in the CSV download and the e-mailed CSV
  • Bump the app version to 0.0.93 so existing installs run the migration

Fixes #288

Exporting a timeline failed with HTTP 500 ("cost is not a valid
attribute") whenever the selected range contained time entries:
postTimeline() calls TimelineEntry::setCost(), but timeline entries had
no cost field or column. The timeline itself was already inserted, so
every failed export also left an empty timeline behind.

- Add a nullable cost column (cents, like work intervals) to
  timetracker_timeline_entry, and the property on TimelineEntry
- Create the timeline and its entries in one transaction, so a failing
  entry doesn't leave an empty timeline
- Include the cost and the total cost in the CSV download and the
  e-mailed CSV
- Bump the app version to 0.0.93 so existing installs run the migration

Fixes #288

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015KJpM1wJdw3Uxw5p86uRBD
@Martin-1997
Martin-1997 merged commit 9ca569b into master Oct 24, 2026
10 checks passed
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.

Exporting a timeline fails with HTTP 500 and leaves an empty timeline ("cost is not a valid attribute")

1 participant