Skip to content

fix: take into account all changed keys #210

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

Closed

Conversation

SantosVilanculos
Copy link
Contributor

Fix: Account for all changed keys in settingsStore.onDidAnyChange

This commit addresses an issue where only the first changed key was being processed when multiple settings were updated simultaneously. The previous implementation used Object.keys(newValue).find() which stops after finding the first difference.

The updated code now iterates through all keys in the newValue object and compares them to their corresponding values in oldValue. This ensures that every changed setting triggers the notifyLaravel function, providing a complete and accurate representation of settings modifications.

Specifically, this change is crucial in scenarios where:

  • clear() or reset() are called on the settings store.
  • Multiple settings are updated within a single operation.
  • The application is running in watch mode, where consistent updates are expected.

The Object.keys(newValue).filter() method now obtains all changed keys, which are each sent to the notifyLaravel to update the backend for each relevant setting.

@SantosVilanculos SantosVilanculos closed this by deleting the head repository May 21, 2025
@SRWieZ
Copy link
Member

SRWieZ commented May 21, 2025

I'm curious, does the issue still there? Did you found an alternative?

@SantosVilanculos
Copy link
Contributor Author

I'm curious, does the issue still there? Did you found an alternative?

No, I haven't found an alternative. The problem remains.

@SantosVilanculos
Copy link
Contributor Author

I made a new pull request, but I didn't know that deleting a repository fork also closes all open pull requests from it.

New pull request #231

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.

2 participants