Skip to content

Releases: supabase-community/supabase-kt

2.1.6

03 Mar 11:01
b4a7b53
Compare
Choose a tag to compare

Changes

Postgrest

2.2.0-rc-1

28 Feb 20:27
a17b9d5
Compare
Choose a tag to compare
2.2.0-rc-1 Pre-release
Pre-release

Note

WASM support will be skipped again as Ktor won't be releasing a stable version supporting WASM-JS anytime soon.

Changes

Auth

  • Add SessionStatus.Authenticated#isNew: This will be true if the session source is a sign in, sign up or is external. Use this to to determine whether you e.g. change the screen.

2.2.0-alpha-2

22 Feb 13:25
15fc70a
Compare
Choose a tag to compare
2.2.0-alpha-2 Pre-release
Pre-release

Changes

Auth

  • Changes to SessionStatus:
    • The Authenticated now has a source property which can be Storage, SignIn, SignUp, Refresh, External, UserChanged, UserIdentitiesChanged or Unknown
    • The NotAuthenticated status is now a data class rather than an object and has a isSignOut property

Compose Auth

  • (Android) The Credential Manager will now always be used for all Android versions
  • By default, when signing out using Auth#signOut or Auth#clearSession the Google credential will now also be cleared.
  • You now pass in the nonce and extraData when calling startFlow rather than in the plugin settings.
  • If no nonce parameter is specified (or not set to null manually), the library will now take care of generating a nonce and using it for authentication.
  • NativeSignInState#started has been changed to NativeSignInState#status which can be Started or NotStarted
  • The apple native sign in method no longer has any arguments, as they are not needed. Note: I don't think that fixes the Apple Native Sign in problem.

2.1.5

19 Feb 15:17
86accdd
Compare
Choose a tag to compare

Changes

Realtime

  • Fix concurrent calls on Realtime.connect() by @vinceglb in #483

New Contributors

2.1.4

18 Feb 16:59
d4db6c2
Compare
Choose a tag to compare

Changes

Postgrest

2.2.0-alpha-1

16 Feb 16:50
a464abe
Compare
Choose a tag to compare
2.2.0-alpha-1 Pre-release
Pre-release

Changes

Core

  • Reworked internal logging to support new features including:
    • Setting the default logging level within the SupabaseClientBuilder:
      val supabase = createSupabaseClient(url, key) {
         defaultLogLevel = LogLevel.WARNING
      }
      Note: The default logging level is set to LogLevel.INFO
    • Changing the logging level per plugins:
      Auth.setLoggingLevel(LogLevel.NONE)
    • Overall better and more debug log messages

Auth

  • Rename Auth#oAuthUrl to Auth#getOAuthUrl
  • Switch to Ktor for Http Callback Servers when using OAuth on Desktop targets. Signing in using an OAuth provider e.g. with signInWith(Google) will now block the current coroutine until the flow succeeds or times out.
  • Add support for using a Http Callback Server for OAuth in the Kotlin macosX64* and linuxX64 targets
    * Only used if no deeplink host & scheme or a default redirect url is provided.
  • Add AuthConfig#httpCallbackConfig() method for configuring these servers.
  • Add host and scheme auth config properties to common code (will still not used by all targets)
  • Add AuthConfig#defaultRedirectUrl to override the default redirect url used for requests. Defaults to null, which means that everything stays as it is; Desktop targets will use a http callback server, mobile targets deeplinks, etc.

Realtime

  • Add support for realtime message throttling in #471
    There is now a new realtime config property: eventsPerSecond (default is 10), which configures a client-side rate-limit for sending broadcasts, presence updates etc. If this rate-limit is exceeded, any message within this duration will fail.
    Set to a negative number to disable.
    Check the Supabase docs for more information.

2.1.3

06 Feb 19:12
ef117de
Compare
Choose a tag to compare

Changes

Auth

  • [Android]: If enableLifecycleCallbacks is set to true and the app goes to background, the sessionStatus value will get set to LoadingFromState (before it wasn't changed at all). This fixes a problem that caused other plugins to use a potentially expired session after the app goes back into foreground because the session wasn't refreshed yet.
    Note: You obviously have to handle the LoadingFromStorage status, e.g. by showing a loading screen.
    On the client side, it will be on LoadingFromStorage and then back to Authenticated once the session is definitely valid.
  • Add oldStatus property to SessionStatus.Authenticated. This can be used to check if a new status emitted is just a refresh (so the oldStatus will just be Authenticated), or an actual login (e.g. oldStatus will be NotAuthenticated)

Full Changelog: 2.1.2...2.1.3

2.1.2

04 Feb 11:08
7521222
Compare
Choose a tag to compare

Changes

GoTrue

  • Add missing OTP type OtpType.Email.EMAIL by @jan-tennert in #451
    and deprecate SIGNUP and MAGIC_LINK

2.1.1

01 Feb 17:24
435c99d
Compare
Choose a tag to compare

Changes

Postgrest

New Contributors

2.1.0

30 Jan 12:56
3d9502d
Compare
Choose a tag to compare

Notes

The documentation has been updated accordingly.
It might take a bit to appear on Maven Central, as publishing seems to be broken right now

Changes

Add iOS targets to the chat-demo by @hieuwu in #397

Realtime

  • Add an option (Realtime.Config#disconnectOnNoSubscriptions) to automatically disconnect from the websocket, once there is no channel left, which defaults to true. (in #416 by @jan-tennert)
  • Remove the error for Realtime when a channel is already connected by @jollygreenegiant in #430
  • Provide a new (experimental) way to listen to Realtime data (built on top of the existing ones) (in #386 by @jan-tennert):

Note: For both methods, the flows automatically emit the initial data and then listen for events using the existing methods.
Listen for changes in all messages (handles inserts, updates and deletes automatically and emits the updated list)

val messageFlow: Flow<List<Message>> = channel.postgresListDataFlow<Message>( //provide your serializable type (in this case Message)
    table = "messages",
    filter = FilterOperation("id", FilterOperator.IN, listOf(1, 2, 3, 4)), //optional filter
    primaryKey = Message::id //provide the primary key for caching
)

Listen for changes on a single value

val singleMessageFlow: Flow<Message> = channel.postgresSingleDataFlow<Message>( //Automatically emits the updated message and closes on delete
    table = "messages",
    primaryKey = Message::id
) { //this is the same filter builder the Postgrest plugin uses, so you can use everything:
    Message::id eq 2
    or {
        Message::creatorId isIn listOf("1", "2", "3")
        Message::content like "%test%"
    }
}

Listen to presence changes (joins & leaves are handled automatically)

val presenceFlow: Flow<List<User>> = channel.presenceDataFlow<User>()
  • Add a new method for adding a filter to postgres changes:
supabase.channel("channel").postgresChangeFlow<PostgresAction>("public") {
    //Still only one filter supported
    filter("id", FilterOperator.EQ, 2)
    //Note that some values get converted to strings e.g. the List<Int> to (1,2,3)
    filter("id", FilterOperator.IN, listOf(1, 2, 3, 4))
}

New methods:

  • RealtimeChannel#postgresSingleDataFlow
  • RealtimeChannel#postgresListDataFlow
  • RealtimeChannel#presenceDataFlow
  • RealtimeChannelBuilder#filter

GoTrue

Compose Auth

Postgrest