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

Expected 'app.bsky.embed.images' or 'app.bsky.embed.external' or 'app.bsky.embed.record' or 'app.bsky.embed.recordWithMedia' but found 'AppBskyEmbedImages.Main'. #94

Open
ligi opened this issue Apr 15, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@ligi
Copy link

ligi commented Apr 15, 2023

First: thanks for your works! Love there is a Kotlin codebase for Bluesky already
Prefixing this issue: I extracted the API from your codebase to experiment with a bot.
For getTimeline calls with a certain cursor I am seeing this:

com.squareup.moshi.JsonDataException: Expected 'app.bsky.embed.images' or 'app.bsky.embed.external' or 'app.bsky.embed.record' or 'app.bsky.embed.recordWithMedia' but found 'AppBskyEmbedImages.Main'.
	at io.github.akiomik.seiun.api.adapters.Union4JsonAdapter.determineEither(Union4JsonAdapter.kt:99)
	at io.github.akiomik.seiun.api.adapters.Union4JsonAdapter.fromJson(Union4JsonAdapter.kt:61)
	at io.github.akiomik.seiun.api.adapters.Union4JsonAdapter.fromJson(Union4JsonAdapter.kt:15)
	at com.squareup.moshi.internal.NullSafeJsonAdapter.fromJson(NullSafeJsonAdapter.java:41)
	at com.squareup.moshi.kotlin.reflect.KotlinJsonAdapter.fromJson(KotlinJsonAdapter.kt:86)
	at com.squareup.moshi.internal.NullSafeJsonAdapter.fromJson(NullSafeJsonAdapter.java:41)
	at com.squareup.moshi.adapters.PolymorphicJsonAdapterFactory$PolymorphicJsonAdapter.fromJson(PolymorphicJsonAdapterFactory.java:264)
	at com.squareup.moshi.internal.NullSafeJsonAdapter.fromJson(NullSafeJsonAdapter.java:41)
	at com.squareup.moshi.kotlin.reflect.KotlinJsonAdapter.fromJson(KotlinJsonAdapter.kt:86)
	at com.squareup.moshi.internal.NullSafeJsonAdapter.fromJson(NullSafeJsonAdapter.java:41)
	at com.squareup.moshi.kotlin.reflect.KotlinJsonAdapter.fromJson(KotlinJsonAdapter.kt:86)
	at com.squareup.moshi.internal.NullSafeJsonAdapter.fromJson(NullSafeJsonAdapter.java:41)
	at com.squareup.moshi.CollectionJsonAdapter.fromJson(CollectionJsonAdapter.java:81)
	at com.squareup.moshi.CollectionJsonAdapter$2.fromJson(CollectionJsonAdapter.java:55)
	at com.squareup.moshi.internal.NullSafeJsonAdapter.fromJson(NullSafeJsonAdapter.java:41)
	at com.squareup.moshi.kotlin.reflect.KotlinJsonAdapter.fromJson(KotlinJsonAdapter.kt:86)
	at com.squareup.moshi.internal.NullSafeJsonAdapter.fromJson(NullSafeJsonAdapter.java:41)
	at retrofit2.converter.moshi.MoshiResponseBodyConverter.convert(MoshiResponseBodyConverter.java:46)
	at retrofit2.converter.moshi.MoshiResponseBodyConverter.convert(MoshiResponseBodyConverter.java:27)
	at com.slack.eithernet.ApiResultConverterFactory$ApiResultConverter.convert(ApiResult.kt:230)
	at com.slack.eithernet.ApiResultConverterFactory$ApiResultConverter.convert(ApiResult.kt:226)
	at retrofit2.OkHttpCall.parseResponse(OkHttpCall.java:243)
	at retrofit2.OkHttpCall$1.onResponse(OkHttpCall.java:153)
	at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:519)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:829)

Very likely your android app will also stumble over this content.
Also wonder if you would be open to extracting the API to a separate project (I could also PR this)

@ligi
Copy link
Author

ligi commented Apr 15, 2023

Found another one:

com.squareup.moshi.JsonDataException: Not an RFC 3339 date: 2023-04-10T17:59:18.150459
	at com.squareup.moshi.adapters.Iso8601Utils.parse(Iso8601Utils.java:198)
	at com.squareup.moshi.adapters.Rfc3339DateJsonAdapter.fromJson(Rfc3339DateJsonAdapter.java:42)
	at com.squareup.moshi.adapters.Rfc3339DateJsonAdapter.fromJson(Rfc3339DateJsonAdapter.java:35)
	at com.squareup.moshi.kotlin.reflect.KotlinJsonAdapter.fromJson(KotlinJsonAdapter.kt:86)
	at com.squareup.moshi.internal.NullSafeJsonAdapter.fromJson(NullSafeJsonAdapter.java:41)
	at com.squareup.moshi.adapters.PolymorphicJsonAdapterFactory$PolymorphicJsonAdapter.fromJson(PolymorphicJsonAdapterFactory.java:264)
	at com.squareup.moshi.internal.NullSafeJsonAdapter.fromJson(NullSafeJsonAdapter.java:41)
	at com.squareup.moshi.kotlin.reflect.KotlinJsonAdapter.fromJson(KotlinJsonAdapter.kt:86)
	at com.squareup.moshi.internal.NullSafeJsonAdapter.fromJson(NullSafeJsonAdapter.java:41)
	at com.squareup.moshi.kotlin.reflect.KotlinJsonAdapter.fromJson(KotlinJsonAdapter.kt:86)
	at com.squareup.moshi.internal.NullSafeJsonAdapter.fromJson(NullSafeJsonAdapter.java:41)
	at com.squareup.moshi.CollectionJsonAdapter.fromJson(CollectionJsonAdapter.java:81)
	at com.squareup.moshi.CollectionJsonAdapter$2.fromJson(CollectionJsonAdapter.java:55)
	at com.squareup.moshi.internal.NullSafeJsonAdapter.fromJson(NullSafeJsonAdapter.java:41)
	at com.squareup.moshi.kotlin.reflect.KotlinJsonAdapter.fromJson(KotlinJsonAdapter.kt:86)
	at com.squareup.moshi.internal.NullSafeJsonAdapter.fromJson(NullSafeJsonAdapter.java:41)
	at retrofit2.converter.moshi.MoshiResponseBodyConverter.convert(MoshiResponseBodyConverter.java:46)
	at retrofit2.converter.moshi.MoshiResponseBodyConverter.convert(MoshiResponseBodyConverter.java:27)
	at com.slack.eithernet.ApiResultConverterFactory$ApiResultConverter.convert(ApiResult.kt:230)
	at com.slack.eithernet.ApiResultConverterFactory$ApiResultConverter.convert(ApiResult.kt:226)
	at retrofit2.OkHttpCall.parseResponse(OkHttpCall.java:243)
	at retrofit2.OkHttpCall$1.onResponse(OkHttpCall.java:153)
	at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:519)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:829)

@akiomik akiomik added the bug Something isn't working label Apr 17, 2023
@akiomik
Copy link
Owner

akiomik commented Apr 17, 2023

Thank you! The second one is related to #11 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants
@ligi @akiomik and others