Skip to content
This repository was archived by the owner on May 27, 2026. It is now read-only.

fix: take into account all changed keys#210

Closed
SantosVilanculos wants to merge 1 commit into
NativePHP:mainfrom
SantosVilanculos:on-did-any-change
Closed

fix: take into account all changed keys#210
SantosVilanculos wants to merge 1 commit into
NativePHP:mainfrom
SantosVilanculos:on-did-any-change

Conversation

@SantosVilanculos
Copy link
Copy Markdown
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
Copy Markdown
Member

SRWieZ commented May 21, 2025

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

@SantosVilanculos
Copy link
Copy Markdown
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
Copy Markdown
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 subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants