Skip to content

fix(yew-link): surface initial internal fetch errors instead of retrying indefinitely - #4219

Open
cuishuang wants to merge 1 commit into
yewstack:masterfrom
cuishuang:master
Open

fix(yew-link): surface initial internal fetch errors instead of retrying indefinitely#4219
cuishuang wants to merge 1 commit into
yewstack:masterfrom
cuishuang:master

Conversation

@cuishuang

@cuishuang cuishuang commented Sep 7, 2026

Copy link
Copy Markdown

Description

Fix the client-side use_linked_state retry loop caused by initial LinkError::Internal results not being cached.

Initial fetches now cache all completed results, including infrastructure errors. This allows the suspension to resolve and exposes the error through LinkedStateHandle::as_result() instead of creating another identical request.

Refresh behavior remains unchanged: LinkError::Internal results from background refreshes are not cached, so an existing stale value is preserved.

Fixes #4218

Checklist

  • I have reviewed my own code
  • I have added tests

@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown

Visit the preview URL for this PR (updated for commit 80cd486):

https://yew-rs-api--pr4219-master-68tx4rnl.web.app

(expires Tue, 15 Sep 2026 13:14:45 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown

Size Comparison

Details
examples master (KB) pull request (KB) diff (KB) diff (%)
async_clock 100.206 100.206 0 0.000%
boids 164.938 164.938 0 0.000%
communication_child_to_parent 93.710 93.710 0 0.000%
communication_grandchild_with_grandparent 105.993 105.993 0 0.000%
communication_grandparent_to_grandchild 102.314 102.314 0 0.000%
communication_parent_to_child 91.101 91.101 0 0.000%
contexts 106.300 106.300 0 0.000%
counter 86.271 86.271 0 0.000%
counter_functional 88.302 88.302 0 0.000%
dyn_create_destroy_apps 90.170 90.170 0 0.000%
file_upload 98.577 98.577 0 0.000%
function_delayed_input 94.617 94.617 0 0.000%
function_memory_game 168.581 168.581 0 0.000%
function_router 400.298 400.298 0 0.000%
function_todomvc 164.981 164.981 0 0.000%
futures 235.946 235.946 0 0.000%
game_of_life 100.623 100.623 0 0.000%
immutable 258.612 258.612 0 0.000%
inner_html 80.781 80.781 0 0.000%
js_callback 109.758 109.758 0 0.000%
keyed_list 176.339 176.339 0 0.000%
mount_point 84.192 84.192 0 0.000%
nested_list 112.731 112.731 0 0.000%
node_refs 91.776 91.776 0 0.000%
password_strength 1765.649 1765.649 0 0.000%
portals 93.599 93.599 0 0.000%
router 366.529 366.529 0 0.000%
suspense 113.938 113.938 0 0.000%
timer 88.518 88.518 0 0.000%
timer_functional 99.423 99.423 0 0.000%
todomvc 141.977 141.977 0 0.000%
two_apps 86.176 86.176 0 0.000%
web_worker_fib 136.490 136.490 0 0.000%
web_worker_prime 186.573 186.573 0 0.000%
webgl 82.927 82.927 0 0.000%

✅ None of the examples has changed their size significantly.

Comment thread packages/yew-link/src/lib.rs Outdated
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.

use_linked_state retries indefinitely after an initial LinkError::Internal

2 participants