Skip to content

feat(rooms): add integration rooms provider#94

Merged
baba-dev merged 1 commit into
mainfrom
codex/refactor-room-fixtures-into-provider
Sep 19, 2025
Merged

feat(rooms): add integration rooms provider#94
baba-dev merged 1 commit into
mainfrom
codex/refactor-room-fixtures-into-provider

Conversation

@baba-dev
Copy link
Copy Markdown
Owner

Summary

  • add a rooms state provider under custom/integration to own the mock snapshot and expose state setters
  • update the rooms page to consume provider data instead of inline fixtures and adjust desktop/test builds to compile the provider
  • extend UI tests to reset the provider and validate integration-fed snapshots update toggle targets

Testing

  • idf.py build (fails: command not found in container)
  • python tests/ui/test_rooms_page.py (fails: desktop dependencies missing; CMake could not find expected submodules)

https://chatgpt.com/codex/tasks/task_e_68cd5a35083c83249b2a1ba560481aab

@baba-dev baba-dev merged commit 97dee57 into main Sep 19, 2025
1 of 7 checks passed
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

Codex Review: Here are some suggestions.

Reply with @codex fix comments to fix any unresolved comments.

About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you open a pull request for review, mark a draft as ready, or comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex fix this CI failure" or "@codex address that feedback".

Comment on lines +70 to +79
static const rooms_state_t* s_current_state = &DEFAULT_STATE;

const rooms_state_t* rooms_provider_get_state(void)
{
return s_current_state;
}

void rooms_provider_set_state(const rooms_state_t* state)
{
s_current_state = state;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[P1] Avoid storing pointers to caller-owned room snapshots

The provider advertises that callers can treat the returned snapshot as provider-owned, but rooms_provider_set_state simply assigns s_current_state to the caller’s pointer without copying or retaining ownership. If an integration builds a rooms_state_t on the stack (as the tests do) or frees/overwrites the structure after the setter returns, subsequent calls to rooms_provider_get_state will read dangling memory and the UI will dereference invalid entities. The provider should allocate or copy the snapshot it owns, or document and enforce that the passed state must outlive the provider.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant