Skip to content

Persist final downlink metadata - #253

Open
sylvesterkaczmarek wants to merge 1 commit into
nasa:mainfrom
sylvesterkaczmarek:fix/237-downlink-metadata
Open

sylvesterkaczmarek wants to merge 1 commit into
nasa:mainfrom
sylvesterkaczmarek:fix/237-downlink-metadata

Conversation

@sylvesterkaczmarek

Copy link
Copy Markdown
Contributor

Fixes #237.

Keep the existing early metadata write for crash resilience, then rewrite the .md.pb sidecar after downlink validation has established the final completion status. The final write includes time_end, so the persisted metadata now matches the FileDownlink emitted on the bus.

The metadata writer seeks to the start and truncates before rewriting, avoiding stale protobuf bytes when the final message is shorter than the early snapshot.

Validation:

  • go test ./pkg/dwn
  • go test ./pkg/...
  • git diff --check

The regression test decodes the written sidecar and verifies that its final status and end time match the completed downlink message.

@FarkasJoseph FarkasJoseph left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm; should likely be e2e tested

@sylvesterkaczmarek

Copy link
Copy Markdown
Contributor Author

Thanks. I checked the integration harness before expanding this. The regression in this PR already drives the real DownlinkSession event loop through completion and reads the protobuf sidecar back from disk. The Docker/F Prime integration suite currently writes the backend downlink root under /app, which is not shared with the Go test process, so a true transport-to-sidecar assertion would also require changing the integration harness/runtime configuration. I would keep that harness expansion separate from this focused persistence fix.

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.

[Go Backend] Downlink .md.pb metadata always records DOWNLINK_UNKNOWN and no time_end

2 participants