Skip to content

Fix sync status page: community-aware, all sync types, N/A display#213

Merged
neuromechanist merged 3 commits intodevelopfrom
feature/issue-212-fix-sync-status-page
Feb 18, 2026
Merged

Fix sync status page: community-aware, all sync types, N/A display#213
neuromechanist merged 3 commits intodevelopfrom
feature/issue-212-fix-sync-status-page

Conversation

@neuromechanist
Copy link
Member

Closes #212

Summary

  • Bug fix: Papers Sync showed N/A despite sync having run. Root cause: _get_sync_metadata looked for source names like "openalex" but the DB stores "openalex:query_name". Fixed with prefix matching.
  • Community-aware: /sync/status and /sync/health now accept ?community_id=X and query the correct per-community database. Unknown IDs return 404.
  • All sync types: New syncs field in response includes all configured sync types (github, papers, docstrings, mailman, beps, faq) with last_sync and next_run timestamps.
  • Dashboard: Passes community_id to sync status fetch; renderSyncInfo renders all sync types dynamically with "next run" info. Fixed formatRelativeTime to correctly display future timestamps (e.g., "6 days from now" instead of "Less than 1 hour ago").

Changes

  • src/api/routers/sync.py: community_id param + registry validation, prefix matching for papers, all sync types in response, /health endpoint updated, _get_most_recent_sync uses _parse_iso_datetime, exc_info=True on warnings
  • dashboard/osa/index.html: community_id in sync fetch, dynamic sync type rendering, future timestamp support
  • tests/test_api/test_sync.py: regression test for prefix matching bug, syncs field presence, unknown community 404

Test plan

  • All 16 sync tests pass
  • Full test suite passes (pre-existing LLM/agent integration test failures unrelated)
  • Ruff lint and format clean

Fixes #212

- Fix Papers Sync showing N/A: sync_metadata stores source names like
  "openalex:query", not "openalex", so use prefix matching to find the
  most recent timestamp for each source type
- Make /sync/status community-aware: accept community_id query param and
  query the correct community database (previously always used hed default)
- Add all sync types to response: new 'syncs' field includes github,
  papers, docstrings, mailman, beps, faq with last_sync and next_run
- Dashboard: pass community_id to sync status fetch, render all sync
  types dynamically including next scheduled run time
- Validate community_id against registry (404 for unknown)
- Update /sync/health to accept community_id param
- Fix formatRelativeTime to handle future timestamps (next_run)
- Use _parse_iso_datetime in _get_most_recent_sync for robust comparison
- Fix misleading citing_doi comment in papers source lookup
- Add exc_info=True to warning log calls for full tracebacks
- Add tests: prefix matching regression, syncs field, unknown community 404
@github-actions
Copy link
Contributor

github-actions bot commented Feb 18, 2026

Dashboard Preview

Name Link
Preview URL https://feature-issue-212-fix-sync-s.osa-dash.pages.dev
Branch feature/issue-212-fix-sync-status-page
Commit ecaa045

This preview will be updated automatically when you push new commits.

@neuromechanist neuromechanist merged commit f77d8fd into develop Feb 18, 2026
8 checks passed
@neuromechanist neuromechanist deleted the feature/issue-212-fix-sync-status-page branch February 18, 2026 04:16
neuromechanist added a commit that referenced this pull request Feb 18, 2026
* Add OG meta tags to demo and dashboard pages

Add Open Graph and Twitter Card meta tags so sharing
links on Slack, Discord, Twitter, etc. shows a proper
preview card with the OSA branding image from osc.earth.

* Add OSA logo, dark mode, and branded footer

- Inline SVG OSA logo in header (uses currentColor for
  dark mode compatibility)
- Dark mode CSS via prefers-color-scheme on demo page
- Footer with dynamic year, heart, and OSC link
- Consistent deep blue color palette across both pages

* Reorder footer: copyright holder first, then made with love

* Fix review issues: dark mode, meta tags, broken links

- Add dark mode to dashboard (matching frontend theme)
- Add <meta name="description"> to both pages for SEO
- Remove redundant twitter:title/description/image tags
- Fix broken GitHub links (osc-em -> OpenScience-Collective)
- Standardize org name to "OpenScience Collective"
- Move dashboard inline styles to CSS classes
- Rename .footer to .site-footer for consistency

* Enforce mandatory HED tag validation before display (#211)

* Enforce mandatory HED tag validation before display

Fixes #210

* Address review: consistent error handling, sanitize exceptions

* Fix sync status page: community-aware, all sync types, N/A display (#213)

* Fix sync status page: N/A display, all sync types, community-aware

Fixes #212

- Fix Papers Sync showing N/A: sync_metadata stores source names like
  "openalex:query", not "openalex", so use prefix matching to find the
  most recent timestamp for each source type
- Make /sync/status community-aware: accept community_id query param and
  query the correct community database (previously always used hed default)
- Add all sync types to response: new 'syncs' field includes github,
  papers, docstrings, mailman, beps, faq with last_sync and next_run
- Dashboard: pass community_id to sync status fetch, render all sync
  types dynamically including next scheduled run time

* Address review findings: validation, future times, health endpoint

- Validate community_id against registry (404 for unknown)
- Update /sync/health to accept community_id param
- Fix formatRelativeTime to handle future timestamps (next_run)
- Use _parse_iso_datetime in _get_most_recent_sync for robust comparison
- Fix misleading citing_doi comment in papers source lookup
- Add exc_info=True to warning log calls for full tracebacks
- Add tests: prefix matching regression, syncs field, unknown community 404

* Fix test: add isolated_db fixture to community_id test

* Bump version to 0.6.7.dev0

* Address PR review findings

- Fix papers last_sync timestamp comparison: use _parse_iso_datetime
  instead of string max() to avoid wrong result with mixed UTC offsets
- Fix dashboard /sync/health URL: pass community_id param so health
  badge reflects the viewed community, not always 'hed'
- Add tests for /sync/health community_id param: 404 for unknown,
  200 for known community

* Fix logging: add exc_info and upgrade scheduler warning to error

- Add exc_info=True to trigger_sync error log for full tracebacks
- Upgrade scheduler job inspection failure from warning to error
@neuromechanist neuromechanist mentioned this pull request Feb 25, 2026
4 tasks
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.

1 participant