From ad3f45d035d543518f48782de23cf49676441784 Mon Sep 17 00:00:00 2001 From: Bram van den Heuvel Date: Fri, 12 Jan 2024 17:11:07 +0100 Subject: [PATCH 1/4] Update syncTime to be at least 1 --- src/Matrix/Settings.elm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Matrix/Settings.elm b/src/Matrix/Settings.elm index 7703695..6a85e2f 100644 --- a/src/Matrix/Settings.elm +++ b/src/Matrix/Settings.elm @@ -68,4 +68,4 @@ getSyncTime (Vault vault) = -} setSyncTime : Int -> Vault -> Vault setSyncTime time (Vault vault) = - Vault <| Envelope.mapSettings (\s -> { s | syncTime = time }) vault + Vault <| Envelope.mapSettings (\s -> { s | syncTime = max 1 time }) vault From 462aa3a2dc0be615d160a3b72111b994a98fddac Mon Sep 17 00:00:00 2001 From: Bram van den Heuvel Date: Fri, 12 Jan 2024 17:15:07 +0100 Subject: [PATCH 2/4] Fix test --- tests/Test/Matrix/Settings.elm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Test/Matrix/Settings.elm b/tests/Test/Matrix/Settings.elm index c1af931..d0bb441 100644 --- a/tests/Test/Matrix/Settings.elm +++ b/tests/Test/Matrix/Settings.elm @@ -27,7 +27,7 @@ settings = vault |> Matrix.Settings.setSyncTime sync |> Matrix.Settings.getSyncTime - |> Expect.equal sync + |> Expect.equal (max 1 sync) ) ] From 311de94c1f4d698b050cf85a7069f591219cec4d Mon Sep 17 00:00:00 2001 From: Bram van den Heuvel Date: Fri, 12 Jan 2024 17:18:01 +0100 Subject: [PATCH 3/4] Bump to beta 2.1.1 --- elm.json | 2 +- src/Internal/Config/Default.elm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/elm.json b/elm.json index 78baf2d..f7e862c 100644 --- a/elm.json +++ b/elm.json @@ -3,7 +3,7 @@ "name": "noordstar/elm-matrix-sdk-beta", "summary": "Matrix SDK for instant communication. Unstable beta version for testing only.", "license": "EUPL-1.1", - "version": "2.1.0", + "version": "2.1.1", "exposed-modules": [ "Matrix", "Matrix.Event", diff --git a/src/Internal/Config/Default.elm b/src/Internal/Config/Default.elm index 835c430..ffbd273 100644 --- a/src/Internal/Config/Default.elm +++ b/src/Internal/Config/Default.elm @@ -23,7 +23,7 @@ will assume until overriden by the user. -} currentVersion : String currentVersion = - "beta 2.1.0" + "beta 2.1.1" {-| The default device name that is being communicated with the Matrix API. From ead65c07f5207ee7b8016e58c8e5c8549e9013ab Mon Sep 17 00:00:00 2001 From: Bram van den Heuvel Date: Thu, 25 Jan 2024 14:47:54 +0100 Subject: [PATCH 4/4] Write object field documentation --- src/Internal/Config/Text.elm | 102 ++++++++++++++++++++++++++--------- 1 file changed, 77 insertions(+), 25 deletions(-) diff --git a/src/Internal/Config/Text.elm b/src/Internal/Config/Text.elm index 93c9d5a..df063b5 100644 --- a/src/Internal/Config/Text.elm +++ b/src/Internal/Config/Text.elm @@ -232,39 +232,91 @@ fields : } fields = { context = - { accessToken = [] - , baseUrl = [] - , password = [] - , refreshToken = [] - , username = [] - , transaction = [] - , versions = [] + { accessToken = + [ "The access token used for authentication with the Matrix server." + ] + , baseUrl = + [ "The base URL of the Matrix server." + ] + , password = + [ "The user's password for authentication purposes." + ] + , refreshToken = + [ "The token used to obtain a new access token upon expiration of the current access token." + ] + , username = + [ "The username of the Matrix account." + ] + , transaction = + [ "A unique identifier for a transaction initiated by the user." + ] + , versions = + [ "The versions of the Matrix protocol that are supported by the server." + ] } , envelope = - { content = [] - , context = [] - , settings = [] + { content = + [ "The actual data or payload that is wrapped within the envelope." + ] + , context = + [ "The context information associated with the envelope, such as environment or session details." + , "In general, this data cannot be directly configured by the user." + ] + , settings = + [ "The configurable settings that affect how the enveloped data is handled or processed." + ] } , event = - { content = [] - , eventId = [] - , originServerTs = [] - , roomId = [] - , sender = [] - , stateKey = [] - , eventType = [] - , unsigned = [] + { content = + [ "The body of this event, as created by the client which sent it." + ] + , eventId = + [ "The globally unique identifier for this event." + ] + , originServerTs = + [ "Timestamp (in milliseconds since the unix epoch) on originating homeserver when this event was sent." + ] + , roomId = + [ "The ID of the room associated with this event." + ] + , sender = + [ "Contains the fully-qualified ID of the user who sent this event." + ] + , stateKey = + [ "Present if, and only if, this event is a state event. The key making this piece of state unique in the room. Note that it is often an empty string." + , "State keys starting with an @ are reserved for referencing user IDs, such as room members. With the exception of a few events, state events set with a given user’s ID as the state key MUST only be set by that user." + ] + , eventType = + [ "The type of the event." + ] + , unsigned = + [ "Contains optional extra information about the event." + ] } , settings = - { currentVersion = [] - , deviceName = [] - , syncTime = [] + { currentVersion = + [ "Indicates the current version of the Elm SDK." + ] + , deviceName = + [ "Indicates the device name that is communicated to the Matrix API." + ] + , syncTime = + [ "Indicates the frequency in miliseconds with which the Elm SDK should long-poll the /sync endpoint." + ] } , unsigned = - { age = [] - , prevContent = [] - , redactedBecause = [] - , transactionId = [] + { age = + [ "The time in milliseconds that has elapsed since the event was sent. This field is generated by the local homeserver, and may be incorrect if the local time on at least one of the two servers is out of sync, which can cause the age to either be negative or greater than it actually is." + ] + , prevContent = + [ "The previous content for this event. This field is generated by the local homeserver, and is only returned if the event is a state event, and the client has permission to see the previous content." + ] + , redactedBecause = + [ "The event that redacted this event, if any." + ] + , transactionId = + [ "The client-supplied transaction ID, for example, provided via PUT /_matrix/client/v3/rooms/{roomId}/send/{eventType}/{txnId}, if the client being given the event is the same one which sent it." + ] } }