Skip to content

Widget's onLoad Action Can't Access Storage-Bound Inputs #1086

@anserwaseem

Description

@anserwaseem

Describe the bug
Widget's onLoad Action can't access storage-bound inputs

To Reproduce
Widgets with inputs bound to ensemble.storage.get() experience a race condition where the onLoad action is executed before storage is properly hydrated, causing inputs to be unevaluated in the onLoad action.

Example Scenario

# Screen using TasksGrid widget
View:
  body:
    TasksGrid:
      inputs:
        userFilters: ${ensemble.storage.get('userFilters') ?? {}}
# TasksGrid widget definition
Widget:
  inputs:
    - userFilters
  onLoad:
    executeCode: |
      console.log(userFilters); // Always logged {} instead of actual storage data
      // Any logic depending on userFilters would fail
  body:
    Text:
      text: ${userFilters.status} # This works (more info below)

Expected behavior
Storage-Bound Inputs of a widget are evaluated when onLoad action is executed.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingp1High priority

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions