fix(feed): update feed.json after every upload so browser sees new activities
merge_all(user_dir) updates the per-user _merged/ shard but the home page loads feed.json first via loadCombinedFeed. write_combined_feed was only called by the CLI render command, not by the API upload endpoints or the dev watcher, leaving feed.json permanently stale after any runtime upload. Add write_combined_feed(_get_data_dir()) after every merge_all call in /api/upload/bas, /api/upload/raw, the dev.py file watcher, and dev startup.
This commit is contained in:
+4
-1
@@ -66,8 +66,10 @@ def _user_dirs(data: Path) -> list[Path]:
|
||||
|
||||
def _merge_all_users(data: Path) -> None:
|
||||
from bincio.render.cli import _merge_edits, _write_root_manifest
|
||||
from bincio.render.merge import write_combined_feed
|
||||
_merge_edits(data)
|
||||
_write_root_manifest(data)
|
||||
write_combined_feed(data)
|
||||
|
||||
|
||||
def _local_ip() -> str:
|
||||
@@ -148,8 +150,9 @@ def _watch_data(data: Path) -> None:
|
||||
for user_dir in affected:
|
||||
handle = user_dir.name
|
||||
try:
|
||||
from bincio.render.merge import merge_all
|
||||
from bincio.render.merge import merge_all, write_combined_feed
|
||||
merge_all(user_dir)
|
||||
write_combined_feed(data)
|
||||
console.print(f" [dim]↺ {handle}: merged[/dim]")
|
||||
except Exception as exc:
|
||||
console.print(f" [yellow]⚠ {handle}: merge failed — {exc}[/yellow]")
|
||||
|
||||
Reference in New Issue
Block a user