Auto-update StatusLine until newly-published nanopub is verified#462
Merged
Conversation
The previous StatusLine rendered the verification status once at page load and never updated. For freshly-published nanopubs the registry usually has not indexed yet, so users saw "doesn't seem to be properly published (yet)" and had to manually reload — and even then, the empty result was cached for 60s. Hold the rendered state in instance fields read via lambda IModels and, when the initial response is unverified, attach an AjaxSelfUpdatingTimerBehavior that invalidates the cache and re-queries every 3s. Stop once verification succeeds or after a 2-minute hard cap. Verified-on-first-render keeps the previous behavior with no polling. Also enable and fix the previously-commented StatusLineTest cases so they exercise the rendering paths for empty/newer-version/retracted responses. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
🎉 This PR is included in version 4.28.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
StatusLineon the explore page renders the verification status once at page load and never updates. For a just-published nanopub the registry has not indexed yet, so users see "This nanopublication doesn't seem to be properly published (yet). This can take a minute or two…" and have to reload manually. Worse, the empty response is then cached for 60s, so a quick reload shows the same stale message.IModels and, when the initial response is unverified, attach anAjaxSelfUpdatingTimerBehaviorthat invalidates the cache viaApiCache.clearCache(queryRef, 0)and re-queries every 3 seconds. Stop once verification succeeds (latest / newer-version / retracted) or after a 2-minute hard cap.StatusLineTestcases so they exercise the rendering paths for empty / newer-version / multiple-newer-versions / retracted responses (uses valid trusty URIs for ListView item rendering).Why this is safe
POLL_TIMEOUT_MS.O(1)andApiCache.isRunningalready prevents concurrent refreshes.Test plan
mvn -o test -Dtest=StatusLineTest— 5/5 passing (empty / single-newer / multiple-newer / retracted /createComponent).mvn -o testsuite still green (687 tests).🤖 Generated with Claude Code