Skip to content

refactor: Reorganize Zustand state retrievals to prevent potential circular dependencies (resolves #264); Add error logging before postPopUp(). #265

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
May 20, 2025

Conversation

Henry8192
Copy link
Collaborator

@Henry8192 Henry8192 commented May 12, 2025

Description

Resolves #264.

Checklist

  • The PR satisfies the contribution guidelines.
  • This is a breaking change and that has been indicated in the PR title, OR this isn't a
    breaking change.
  • Necessary docs have been updated, OR no docs need to be updated.

Validation performed


Summary by CodeRabbit

  • Refactor
    • Improved the organization and timing of state retrievals across several features for more efficient and localized state access.
    • Streamlined state management in key workflows, resulting in cleaner and more maintainable code.
    • Enhanced the consistency of effect dependencies in the application controller for more reliable updates.
    • Added error logging to improve visibility of asynchronous operation issues.

Copy link

coderabbitai bot commented May 12, 2025

"""

Walkthrough

The changes reorganize the order and locality of Zustand global state retrievals (getState() calls and hook selectors) within various store methods and a React component. State slices are now accessed closer to their point of use, reducing the risk of circular dependencies. No logic, control flow, or public API changes are introduced.

Changes

File(s) Change Summary
src/stores/logExportStore.ts Reordered retrieval of state slices (postPopUp, logFileManagerProxy, fileName, numEvents) within exportLogs to access each closer to use.
src/stores/logFileStore.ts Moved calls to other stores’ getState() methods within loadFile to just before their usage, grouping related state access together. No logic or API changes.
src/stores/queryStore/createQueryControllerSlice.ts Changed the order of clearQueryResults() and state retrievals (postPopUp, logFileManagerProxy) in startQuery so state is accessed immediately before use.
src/stores/viewStore.ts Reorganized state retrieval calls in several methods (filterLogs, loadPageByAction, updateIsPrettified, updatePageData) to occur closer to where values are used. No logic or API changes.
src/components/AppController.tsx Switched from using getState() to hook selectors for updatePageData and logFileManagerProxy; updated effect dependencies accordingly. No change to logic or component API.

Sequence Diagram(s)

sequenceDiagram
    participant Component
    participant StoreA
    participant StoreB

    Note over Component: Example of reorganized state retrieval
    Component->>StoreA: getState() or hook selector (just before use)
    Component->>StoreB: getState() or hook selector (just before use)
    Component->>Component: Use retrieved state
Loading

Assessment against linked issues

Objective Addressed Explanation
Refactor Zustand state store imports to be placed right before their usage in functions (#264)

Possibly related PRs

Suggested reviewers

  • junhaoliao
    """

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

npm warn config production Use --omit=dev instead.
npm error Exit handler never called!
npm error This is an error with npm itself. Please report this error at:
npm error https://github.com/npm/cli/issues
npm error A complete log of this run can be found in: /.npm/_logs/2025-05-20T14_31_04_956Z-debug-0.log

Note

⚡️ AI Code Reviews for VS Code, Cursor, Windsurf

CodeRabbit now has a plugin for VS Code, Cursor and Windsurf. This brings AI code reviews directly in the code editor. Each commit is reviewed immediately, finding bugs before the PR is raised. Seamless context handoff to your AI code agent ensures that you can easily incorporate review feedback.
Learn more here.


Note

⚡️ Faster reviews with caching

CodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure Review - Disable Cache at either the organization or repository level. If you prefer to disable all data retention across your organization, simply turn off the Data Retention setting under your Organization Settings.
Enjoy the performance boost—your workflow just got faster.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d4732b4 and b29cd52.

📒 Files selected for processing (1)
  • src/components/AppController.tsx (3 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
`**/*.{cpp,hpp,java,js,jsx,tpp,ts,tsx}`: - Prefer `false == ` rather than `!`.

**/*.{cpp,hpp,java,js,jsx,tpp,ts,tsx}: - Prefer false == <expression> rather than !<expression>.

  • src/components/AppController.tsx
🧠 Learnings (1)
📓 Common learnings
Learnt from: junhaoliao
PR: y-scope/yscope-log-viewer#265
File: src/stores/logFileStore.ts:125-125
Timestamp: 2025-05-17T05:13:39.947Z
Learning: When refactoring Zustand state imports to prevent circular dependencies in the yscope-log-viewer project, the preferred pattern is to move state retrievals closest to where they're actually used rather than retrieving them at the beginning of the function.
🧬 Code Graph Analysis (1)
src/components/AppController.tsx (2)
src/services/LogFileManager/index.ts (2)
  • numEvents (124-126)
  • cursor (492-514)
src/typings/worker.ts (2)
  • CursorType (107-107)
  • CURSOR_CODE (100-100)
🔇 Additional comments (6)
src/components/AppController.tsx (6)

87-89: Good reorganization of state and action retrieval

This refactoring moves Zustand state selectors closer to their usage points, following the preferred pattern for preventing circular dependencies. Retrieving setLogEventNum and setPostPopUp from the context store at the top makes sense as they're used in multiple effect hooks.


92-94: Appropriate refactoring of view store selectors

Moving these view store selectors after the other store hooks aligns with the project's convention and keeps related selectors grouped together. This organization helps prevent potential circular dependencies as mentioned in PR #264.


127-127: Improved variable declaration placement

Moving the clamping operation earlier in the effect makes the code more readable by clearly establishing the valid range before performing operations with the value.


144-144: Good use of the selector function for updating page data

Using the updatePageData selector function from useViewStore instead of directly accessing state helps encapsulate state updates and follows Zustand best practices for state management.


146-146: Improved error handling with logging

Adding error logging before showing the notification is a good practice that will help with debugging when issues occur.


160-161: Updated effect dependencies correctly

The dependency array now properly includes all dependencies used in the effect, including the newly used updatePageData function. This ensures the effect runs when necessary and prevents potential stale closure issues.

✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@junhaoliao junhaoliao changed the title Refactor: Reorganize Zustand state imports to prevent potential circular dependencies (Resolves #264). refactor: Reorganize Zustand state imports to prevent potential circular dependencies (Resolves #264). May 13, 2025
@junhaoliao junhaoliao changed the title refactor: Reorganize Zustand state imports to prevent potential circular dependencies (Resolves #264). refactor: Reorganize Zustand state imports to prevent potential circular dependencies (resolves #264). May 13, 2025
@Henry8192 Henry8192 marked this pull request as ready for review May 14, 2025 17:39
@Henry8192 Henry8192 requested a review from a team as a code owner May 14, 2025 17:39
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 14082f5 and 0cef615.

📒 Files selected for processing (5)
  • src/contexts/AppController.tsx (3 hunks)
  • src/stores/logExportStore.ts (1 hunks)
  • src/stores/logFileStore.ts (2 hunks)
  • src/stores/queryStore/createQueryControllerSlice.ts (1 hunks)
  • src/stores/viewStore.ts (6 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
`**/*.{cpp,hpp,java,js,jsx,tpp,ts,tsx}`: - Prefer `false == ` rather than `!`.

**/*.{cpp,hpp,java,js,jsx,tpp,ts,tsx}: - Prefer false == <expression> rather than !<expression>.

  • src/stores/queryStore/createQueryControllerSlice.ts
  • src/stores/logExportStore.ts
  • src/stores/viewStore.ts
  • src/stores/logFileStore.ts
  • src/contexts/AppController.tsx
🧬 Code Graph Analysis (3)
src/stores/logExportStore.ts (2)
src/services/LogFileManager/index.ts (3)
  • numEvents (124-126)
  • fileName (116-118)
  • fileName (200-221)
src/utils/config.ts (1)
  • EXPORT_LOGS_CHUNK_SIZE (181-181)
src/stores/logFileStore.ts (2)
src/services/LogFileManager/index.ts (2)
  • create (164-189)
  • cursor (492-514)
src/typings/worker.ts (2)
  • FileSrcType (108-108)
  • CursorType (107-107)
src/contexts/AppController.tsx (1)
src/services/LogFileManagerProxy.ts (1)
  • loadFile (17-42)
🔇 Additional comments (16)
src/stores/queryStore/createQueryControllerSlice.ts (1)

54-55: Good adjustment of state retrieval timing

Moving the state retrieval after the early return check is a good optimization. This ensures that postPopUp and logFileManagerProxy are only accessed when they're actually needed, avoiding unnecessary state retrieval when the function exits early.

src/stores/logExportStore.ts (2)

39-40: Improved order of state retrieval

Getting fileName and numEvents first is logical since they're needed immediately for creating the LogExportManager. This reorganization improves code locality by grouping related operations together.


47-48: Appropriate state retrieval sequencing

Deferring retrieval of postPopUp and logFileManagerProxy until closer to where they're used in the async function is a good practice. This supports the PR's goal of preventing potential circular dependencies by localizing state access.

src/stores/logFileStore.ts (3)

100-101: Valid eslint comment

The eslint-disable comment is appropriate since you're refactoring the code organization without changing the overall function structure. Future work might consider breaking this function into smaller pieces to avoid needing the eslint exception.


108-108: Good separation of state retrieval

Extracting only setLogData at this point and deferring other state until needed is appropriate since it's used earlier in the function and aligns with the PR's goal of reducing potential circular dependencies.


123-125: Effective reorganization of state access

Moving these state retrievals closer to their usage in the async function follows good code organization principles and helps prevent potential circular dependencies by localizing state access to where it's needed.

src/contexts/AppController.tsx (4)

92-93: Improved React state access pattern

Using the selector pattern with useViewStore((state) => state.updatePageData) is better than calling getState() inside effects. This follows React best practices by properly subscribing to state changes and including them in dependency arrays.


94-95: Consistent state access pattern

Using the selector pattern for logFileManagerProxy maintains consistency with other state access in the component and follows recommended patterns for Zustand stores in React components.


149-149: Simplified state usage

Using the directly retrieved updatePageData function is cleaner than calling through getState() and avoids potential issues with stale state references in asynchronous contexts.


164-166: Properly updated effect dependencies

Adding updatePageData to the dependency array is correct since it's used within the effect. This ensures the effect runs when this dependency changes, following React's rules of hooks.

src/stores/viewStore.ts (6)

115-117: Localise state selection in filterLogs
Declaring updatePageData, logEventNum, postPopUp, and logFileManagerProxy immediately before they're used enhances readability and ensures the values are fresh. This also minimises the surface area for potential circular dependencies by limiting when and where these imports are accessed.


162-162: Guard navigation with UI readiness check
Retrieving uiState from useUiStore before proceeding ensures that page navigation only occurs when the interface is in a READY state, reducing the risk of race conditions or conflicting loads.


208-209: Show fast loading state on toggle prettification
Invoking setUiState(UI_STATE.FAST_LOADING) at the start of the prettification toggle provides immediate visual feedback to the user, aligning the UI behaviour with the underlying asynchronous operation.


213-213: Localise context store access for error handling
Destructuring logEventNum and postPopUp right before the catch block ensures that these values are captured at the moment of need and helps prevent unintended import order or circular dependency issues.


222-223: Optimise state retrieval for prettification flow
Pulling updatePageData and logFileManagerProxy immediately before the asynchronous call keeps related code together, improving locality and guarding against stale closures or circular import pitfalls.


246-246: Reset UI state after updating page data
Moving setUiState(UI_STATE.READY) to execute after both the store update and the URL hash change ensures the UI only transitions to the ready state once all side effects have completed.

@junhaoliao junhaoliao self-requested a review May 14, 2025 18:12
@Henry8192
Copy link
Collaborator Author

@junhaoliao if possible, let's merge this before we rebase #152, as it fixes some zustand store usage errors.

Henry8192 added 2 commits May 15, 2025 18:40
# Conflicts:
#	src/stores/queryStore/createQueryControllerSlice.ts
# Conflicts:
#	src/stores/queryStore/createQueryControllerSlice.ts
@junhaoliao
Copy link
Member

junhaoliao commented May 16, 2025

@Henry8192 can you merge from main?

i merged on my end instead

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 10697e9 and b07cf05.

📒 Files selected for processing (1)
  • src/components/AppController.tsx (3 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
`**/*.{cpp,hpp,java,js,jsx,tpp,ts,tsx}`: - Prefer `false == ` rather than `!`.

**/*.{cpp,hpp,java,js,jsx,tpp,ts,tsx}: - Prefer false == <expression> rather than !<expression>.

  • src/components/AppController.tsx
🧬 Code Graph Analysis (1)
src/components/AppController.tsx (3)
src/services/LogFileManager/index.ts (2)
  • numEvents (124-126)
  • cursor (492-514)
src/typings/states.ts (1)
  • UI_STATE (106-106)
src/typings/worker.ts (2)
  • CursorType (107-107)
  • CURSOR_CODE (100-100)
🔇 Additional comments (5)
src/components/AppController.tsx (5)

87-95: Store access re-organization for improved code structure

The refactoring of the hook usage reorganizes Zustand state imports to prevent circular dependencies. Moving store-specific selectors together makes the code more maintainable and easier to track dependencies.


127-128: Improved input validation order

Moving the clamping logic earlier in the code flow is a good improvement that ensures the event number is valid before proceeding with further operations.


144-144: Improved state management approach

Using the updatePageData selector from the store is a better approach than directly mutating state.


146-146: Enhanced error logging

Adding console error logging before displaying the popup provides better debugging information without affecting the user experience.


154-162: Updated effect dependencies

The effect dependency array has been properly updated to include updatePageData since it's now being used within the effect. This ensures the effect will re-run when any of its dependencies change.

(async () => {
const {logFileManagerProxy} = useLogFileManagerProxyStore.getState();
const decoderOptions = getConfig(CONFIG_KEY.DECODER_OPTIONS);
const {isPrettified} = useViewStore.getState();
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Can we move this before const pageData, where it is being used?

hoophalab

This comment was marked as resolved.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 43ebb53 and 6695ad0.

📒 Files selected for processing (1)
  • src/stores/logFileStore.ts (2 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
`**/*.{cpp,hpp,java,js,jsx,tpp,ts,tsx}`: - Prefer `false == ` rather than `!`.

**/*.{cpp,hpp,java,js,jsx,tpp,ts,tsx}: - Prefer false == <expression> rather than !<expression>.

  • src/stores/logFileStore.ts
🧬 Code Graph Analysis (1)
src/stores/logFileStore.ts (8)
src/services/LogFileManager/index.ts (2)
  • create (164-189)
  • cursor (492-514)
src/typings/worker.ts (2)
  • FileSrcType (108-108)
  • CursorType (107-107)
src/typings/states.ts (1)
  • UI_STATE (106-106)
src/stores/logExportStore.ts (1)
  • LOG_EXPORT_STORE_DEFAULT (65-65)
src/contexts/UrlContextProvider.tsx (1)
  • updateWindowUrlSearchParams (279-279)
src/typings/url.ts (1)
  • SEARCH_PARAM_NAMES (38-38)
src/utils/config.ts (1)
  • getConfig (182-182)
src/typings/config.ts (1)
  • CONFIG_KEY (44-44)
🔇 Additional comments (5)
src/stores/logFileStore.ts (5)

100-100: LGTM: Added ESLint directive.

This directive is appropriate for the function since it exceeds the line limit.


105-105: Good improvement: UI state now set immediately.

Moving this UI state update to the beginning of the function ensures users see the loading state right away, improving the perceived responsiveness of the application.


107-119: Good refactoring: State access now grouped by usage.

Reorganizing the state access to be closer to where it's used improves code readability and reduces the risk of circular dependencies between stores.


127-129: Good refactoring: Deferred state access until needed.

Moving these accesses inside the async function means they're retrieved just before they're needed, which is good practice for preventing circular dependencies.


141-143: Good refactoring: ViewStore state accessed at point of use.

Moving these state accesses after setting the file info and right before they're used improves code organization and maintainability.

setLogData("Loading...");

set({fileSrc});
if ("string" !== typeof fileSrc) {
updateWindowUrlSearchParams({[SEARCH_PARAM_NAMES.FILE_PATH]: null});
}

const decoderOptions = getConfig(CONFIG_KEY.DECODER_OPTIONS);
const {postPopUp} = useContextStore.getState();
Copy link

@coderabbitai coderabbitai bot May 16, 2025

Choose a reason for hiding this comment

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

🧹 Nitpick (assertive)

Consider moving postPopUp inside the async function.

For consistency with the pattern of other state retrievals in this PR, consider moving this line inside the async function, closer to where it's used in the catch block at line 153.

- const {postPopUp} = useContextStore.getState();
  (async () => {
      const {logFileManagerProxy} = useLogFileManagerProxyStore.getState();
      const decoderOptions = getConfig(CONFIG_KEY.DECODER_OPTIONS);

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In src/stores/logFileStore.ts at line 125, the variable postPopUp is retrieved
from useContextStore.getState() outside the async function, but for consistency
with other state retrievals and to keep the code cleaner, move the declaration
of postPopUp inside the async function, closer to its usage in the catch block
around line 153. This will ensure the state is accessed only when needed and
aligns with the pattern used elsewhere in the code.

Copy link
Member

Choose a reason for hiding this comment

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

if i move it into the async function, don't i need to retrieve postPopUp again in the catch handler?

Copy link

Choose a reason for hiding this comment

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

@junhaoliao You're absolutely right! If you move postPopUp into the main async function body, you would need to retrieve it again in the catch handler since the scope would be different.

Looking at other changes in this PR, I see a pattern where state retrievals are moved closer to their actual usage points. For postPopUp specifically, a consistent approach would be to move it directly inside the catch handler where it's needed:

(async () => {
    const {logFileManagerProxy} = useLogFileManagerProxyStore.getState();
    const decoderOptions = getConfig(CONFIG_KEY.DECODER_OPTIONS);
    // ...rest of function...
    
    if (0 === decoderOptions.formatString.length && canFormat) {
        const {postPopUp} = useContextStore.getState();
        postPopUp(FORMAT_POP_UP_MESSAGE);
    }
})().catch((e: unknown) => {
    console.error(e);
    const {postPopUp} = useContextStore.getState();
    postPopUp({
        level: LOG_LEVEL.ERROR,
        message: String(e),
        timeoutMillis: DO_NOT_TIMEOUT_VALUE,
        title: "Action failed",
    });
    setUiState(UI_STATE.UNOPENED);
});

This approach keeps the state retrieval closest to where it's used, which seems to be the pattern in this refactoring.


✏️ Learnings added
Learnt from: junhaoliao
PR: y-scope/yscope-log-viewer#265
File: src/stores/logFileStore.ts:125-125
Timestamp: 2025-05-17T05:13:39.921Z
Learning: When refactoring Zustand state imports to prevent circular dependencies in the yscope-log-viewer project, the preferred pattern is to move state retrievals closest to where they're actually used rather than retrieving them at the beginning of the function.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

@junhaoliao junhaoliao requested a review from hoophalab May 20, 2025 15:35
Copy link
Member

@junhaoliao junhaoliao left a comment

Choose a reason for hiding this comment

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

Let's see if @hoophalab has any other comments. Otherwise, I'm good with the changes

for the title, how about

  1. rephrasing state imports -> state retrievals?
  2. mentioning that we added console.error for all places we call postPopUp() with errors?
    i.e.,
refactor: Reorganize Zustand state retrievals to prevent potential circular dependencies (resolves #264); Add error logging before `postPopUp()`.

hoophalab
hoophalab approved these changes May 20, 2025
@Henry8192 Henry8192 changed the title refactor: Reorganize Zustand state imports to prevent potential circular dependencies (resolves #264). Let's see if @hoophalab has any other comments. Otherwise, I'm good with the changes for the title, how about rephrasing state imports -> state retrievals? mentioning that we added console.error for all places we call postPopUp() with errors? i.e., refactor: Reorganize Zustand state retrievals to prevent potential circular dependencies (resolves #264); Add error logging before postPopUp(). May 20, 2025
@Henry8192 Henry8192 changed the title Let's see if @hoophalab has any other comments. Otherwise, I'm good with the changes for the title, how about rephrasing state imports -> state retrievals? mentioning that we added console.error for all places we call postPopUp() with errors? i.e., refactor: Reorganize Zustand state retrievals to prevent potential circular dependencies (resolves #264); Add error logging before postPopUp(). refactor: Reorganize Zustand state retrievals to prevent potential circular dependencies (resolves #264); Add error logging before postPopUp(). May 20, 2025
@Henry8192 Henry8192 merged commit 69d59c9 into y-scope:main May 20, 2025
4 of 5 checks passed
@Henry8192 Henry8192 deleted the zustand-refactor branch May 20, 2025 16:18
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.

Refactor: Reorganize Zustand state imports to prevent potential circular dependencies
3 participants