From 4f30fd5a70754f6ebbe7a7a10d8b0a5b20593cef Mon Sep 17 00:00:00 2001 From: epoberezkin Date: Fri, 25 Jul 2025 20:17:51 +0000 Subject: [PATCH] deploy: b2f9ee43263534f3c98eda9f63ff88877ac1c605 --- docs/contributing.html | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/docs/contributing.html b/docs/contributing.html index 6567b2c47e..9201c81aa8 100644 --- a/docs/contributing.html +++ b/docs/contributing.html @@ -911,7 +911,7 @@ window.addEventListener('scroll',changeHeaderBg); -

| Updated 31.01.2023 | Languages: EN, FR, CZ, PL |

+

| Updated 25.07.2025 | Languages: EN, FR, CZ, PL |

Contributing guide

Compiling with SQLCipher encryption enabled

Add cabal.project.local to project root with the location of OpenSSL headers and libraries and flag setting encryption mode:

@@ -1017,6 +1017,22 @@ let r' = (record :: Record) {field = value} import Control.Monad

This PR has all the differences.

+

Improving compatibility between versions for remote desktop connection

+

UI already can handle failed JSON conversions of chats and chat items, and it helps both debugging and downgrading.

+

While we can increase versions for remote connections to make different versions incompatible, it degrades remote connection UX, as in many cases users can't upgrade mobile or desktop apps at the same time because of different release cycles.

+

It is especially problematic for Android app users, as they can only downgrade via Export/Import - older version can't be installed on top of newer version.

+

PR #6105 improved it by:

+
    +
  • adding CInfoInvalidJSON constructor, so that chats that cannot be parsed will show as "invalid chat" via remote connection (as when UI has field not present in API),
  • +
  • changing JSON parsing for CIContent, so that it falls back to CIInvalidJSON in platform-specific JSON parser.
  • +
+

To avoid "invalid" chats in the list we need to maintain forward compatibility on JSON encoding level of AChat type and subtypes:

+
    +
  • add new fields as optional to these types,
  • +
  • add omittedField method to FromJSON instances of types of new fields to provide a default value, where appropriate,
  • +
  • define primitive non-optional fields as newtype with omittedField in JSON instance.
  • +
+

To avoid fallback to invalid JSON in chat items we should do the same for ChatItem type and subtypes. It's especially important when adding fields to types used for all CIContent, as otherwise all items will be broken.