Skip to content

fix(subscription): preserve valid persisted fallback - #1082

Open
Zhanfg wants to merge 1 commit into
daeuniverse:mainfrom
Zhanfg:fix/persist-subscription-integrity-1076
Open

fix(subscription): preserve valid persisted fallback#1082
Zhanfg wants to merge 1 commit into
daeuniverse:mainfrom
Zhanfg:fix/persist-subscription-integrity-1076

Conversation

@Zhanfg

@Zhanfg Zhanfg commented Aug 16, 2026

Copy link
Copy Markdown

Background

Persistent http-file / https-file subscriptions are intended to provide a last-known-good fallback when a remote subscription cannot be refreshed.

Previously, a successful HTTP request could overwrite the persisted file before the response was proven to contain usable subscription nodes. An empty, invalid, locked, or otherwise unusable response could therefore destroy the valid fallback.

This change validates fetched subscription content before persistence, falls back to the existing persisted subscription for invalid responses and non-2xx HTTP responses, and replaces valid persisted data atomically using a temporary file and rename.

The persisted file remains mode 0600.

There is partial overlap with #1058, which also contains persistence handling as part of the much larger group-entry-chain feature. This PR intentionally keeps the subscription integrity fix independent and narrowly scoped, and additionally covers non-2xx HTTP fallback behavior.

Checklist

Full Changelogs

  • Preserve the last valid persisted subscription when refreshed content contains no usable nodes.
  • Fall back to persisted content on non-2xx HTTP responses.
  • Atomically replace persisted subscription files only after validation.
  • Keep persisted subscription permissions at 0600.
  • Add regression coverage for invalid responses, valid replacement, and HTTP error fallback.

Issue Reference

Closes #1076.

Also addresses #1007.

Related: #1058 contains partially overlapping persistence handling inside a larger feature PR.

Test Result

  • Focused subscription regression tests passed.
  • go test -tags dae_stub_ebpf ./... passed on the fork runner.
  • HTTP 503 → persisted fallback regression coverage was added during final review.
  • git diff --check passed.

@Zhanfg
Zhanfg requested a review from a team as a code owner August 16, 2026 03:53
@Zhanfg
Zhanfg requested a review from a team as a code owner August 16, 2026 04:54
@github-actions
github-actions Bot force-pushed the fix/persist-subscription-integrity-1076 branch from 28e742b to 7623b8f Compare August 16, 2026 04:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug Report] 对部分可上锁的订阅链接相应不当

1 participant