Skip to content
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

Makes sure to return promise from setObject logic. … #2967

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

Apollon77
Copy link
Collaborator

Affects setObject and extendObject at least

Implementation details
Return the promise from _setObjectWithDefaultValue to the calling method else this gets lost when no callback was provided

Tests

  • I have added tests to avoid a recursion of this bug
  • It is not possible to test for this bug

If no tests added, please specify why it was not possible
change is too obbvious :-)

Comment on lines +2779 to +2783
setObject(
id: string,
obj: ioBroker.SettableObject,
callback?: ioBroker.SetObjectCallback,
): Promise<ioBroker.NonNullCallbackReturnTypeOf<ioBroker.SetObjectCallback> | void>;

Check warning

Code scanning / CodeQL

Unreachable method overloads Warning

This overload of setObject() is unreachable, the
previous
overload will always be selected.
@foxriver76
Copy link
Collaborator

foxriver76 commented Nov 17, 2024

After merging we should depreacte setObjectAsync (else we loose track of whats already working) in a separate PR and maybe also add a test, that setObject works correctly promise-based. Or I can also add it as part of this PR if you like @Apollon77

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.

3 participants