Skip to content

add migration info for Void -> EmptyResponse#636

Merged
David-Development merged 8 commits intomainfrom
call-void-fix
Jan 24, 2024
Merged

add migration info for Void -> EmptyResponse#636
David-Development merged 8 commits intomainfrom
call-void-fix

Conversation

@David-Development
Copy link
Member

No description provided.

@David-Development
Copy link
Member Author

@stefan-niedermann Here you said:

Calls are not affected by the EmptyResponse solution and can still use Void (or EmptyResponse) if wanted

I'm using Calls in the Nextcloud News App (e.g. here) and it received the error

Could not instantiate java.lang.Void, because response was null.

After changing it to EmptyResponse it worked. That's why I added a migration note for devs that run into this Problem.

@stefan-niedermann
Copy link
Member

Hmm... I can't reproduce this issue 🧐 We are using Call<Void> successfully in the Deck app (at least on a branch).

Could not instantiate java.lang.Void, because response was null.

This error message suggests one is trying to instantiate Void (the workaround we removed in SSO 1.0.0) and it must not happen any longer. Are you absolutely sure you do not use SSO below 1.0.0 and also don't have idk any transitive dependencies or so?

@David-Development
Copy link
Member Author

I cloned the Single-Sign-On Repo into the news app and included it as a gradle project dependency in the settings.gradle. So I'm fairly sure that it's version 1.0.0 🙈 And in the deck app it works with the latest version and the Call<Void>?

@stefan-niedermann
Copy link
Member

On the observable2call branch, yup 🤷

Where exactly is the error message (Could not instantiate java.lang.Void, because response was null.) coming from? At some point Void must get instantiated - where is it?

@David-Development
Copy link
Member Author

@stefan-niedermann Here: https://github.com/nextcloud/Android-SingleSignOn/pull/636/files#diff-c367b4028a9db1f826b9e7657605ad06e197238f3ab5e4a6d438dcd8c01d1983R151

The response is null (because the server doesn't return anything) so it checks if the the targetEntity is an Object - which it isn't so it throws the exception. Maybe in your case the server returns something and you just ignore it? That would probably be a different case

Copy link
Member

@stefan-niedermann stefan-niedermann left a comment

Choose a reason for hiding this comment

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

One more thing: Please adjust the README, there's a hint to EmptyResponse which should be rewritten to also match Calls then

stefan-niedermann added a commit to stefan-niedermann/nextcloud-deck that referenced this pull request Jan 23, 2024
…latter will be removed in the next SSO version

Refs: nextcloud/Android-SingleSignOn#636

Signed-off-by: Stefan Niedermann <info@niedermann.it>
@AndyScherzinger AndyScherzinger added the 3. to review Waiting for reviews label Jan 24, 2024
Signed-off-by: David Luhmer <david-dev@live.de>
Copy link
Member

@stefan-niedermann stefan-niedermann left a comment

Choose a reason for hiding this comment

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

Not sure whether the explanation is still valid (given Calls are not related to RxJava), but yeah, the hint is there.

@David-Development David-Development merged commit 8d787c4 into main Jan 24, 2024
@David-Development David-Development deleted the call-void-fix branch January 24, 2024 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants