Skip to content

Fixed 'From Context' blocking thread on resolving data not provided on nearest Context Node#70

Merged
GuilhermeF03 merged 2 commits into
mainfrom
bug/context-data-fetching-hanging-app
Mar 26, 2026
Merged

Fixed 'From Context' blocking thread on resolving data not provided on nearest Context Node#70
GuilhermeF03 merged 2 commits into
mainfrom
bug/context-data-fetching-hanging-app

Conversation

@GuilhermeF03
Copy link
Copy Markdown
Member

Summary

This PR solves the bug reported in #69 , where the app would block if any node would try to resolve data that wasn't provided in the nearest Context node.

Changes

  • FromContext now continues backtracking the tree when no matching key is found. Previously this would iterate over the while loop indefinitely.

Related Issues

Closes #69

How to Test

  1. Wrap a node with a Context
  2. Try to resolve a key that wasn't provided

Copy link
Copy Markdown
Collaborator

@rcosta358 rcosta358 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Comment on lines +92 to +94
val value = current.provided[key]
if (value != null) {
return value() as T
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@GuilhermeF03 GuilhermeF03 merged commit 645678c into main Mar 26, 2026
5 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog to Done in canopy-tasks Mar 26, 2026
@GuilhermeF03 GuilhermeF03 deleted the bug/context-data-fetching-hanging-app branch March 26, 2026 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Bug: Context fetching hangs if no data is found on nearest context node

2 participants