Git Product home page Git Product logo

seiun's Issues

Support high-quality image uploading

Currently:

  • Converted to bitmap
  • Resize image if necessary
  • Compress bitmap as jpeg
  • Upload jpeg

Expected:

  • Resize or compress if the size is larger than 1000px or 300KB
  • Upload in its original format

fun convertToUploadableImage(source: ImageDecoder.Source): ByteArray {
val bitmap = resizeImage(ImageDecoder.decodeBitmap(source))
val stream = ByteArrayOutputStream()
bitmap.compress(Bitmap.CompressFormat.JPEG, 100, stream)
return stream.toByteArray()
}

Support for My Feeds

https://bsky.app/feeds

request (replace $server with your local server, and $jwt with your jwt token)

GET /xrpc/app.bsky.actor.getPreferences HTTP/2
Host: enoki.$server.host.bsky.network
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:120.0) Gecko/20100101 Firefox/120.0
Accept: */*
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate, br
authorization: Bearer $jwt
Origin: https://bsky.app
DNT: 1
Sec-GPC: 1
Connection: keep-alive
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: cors
Sec-Fetch-Site: cross-site
If-None-Match: W/"349-SWwpR5qWL31vpiXvOJvXryqYzQU"
TE: trailers

response

{
	"preferences": [
		{
			"$type": "app.bsky.actor.defs#savedFeedsPref",
			"pinned": [
				"at://did:plc:...",
				"at://did:plc:...",
				"at://did:plc:...",
				"at://did:plc:...",
				"at://did:plc:..."
			],
			"saved": [
				"at://did:plc:...",
				"at://did:plc:...",
				"at://did:plc:...",
				"at://did:plc:...",
				"at://did:plc:...",
				"at://did:plc:...",
				"at://did:plc:...",
				"at://did:plc:...",
				"at://did:plc:...",
				"at://did:plc:..."
			]
		}
	]
}

【Bug】リポスト・ふぁぼのクロスタイミングでのリアクション表記が実態とずれる

ふぁぼ→リポスト→ふぁぼレスポンス→リポストレスポンス

この状態の時、ふぁぼのアイコンがアクティブにならず、リポストのみ完了したことになってしまいます。

処理がキャンセルされてしまう・・・?
実際の挙動を見ていると、ふぁぼ・リポストともに完了していることを確認しました

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

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.