mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-11-22 19:58:26 +00:00
core, ui: chatItemUpdated event has the previous item (#8219)
* core, ui: chatItemUpdated event has the previous item Apps change counters by the difference between the previous and the new item, and insert an updated item only when the update created it. * core, ui: a recreated item is sent as newChatItems An update of a locally deleted message creates it again and sends it as a new item, so chatItemUpdated always has the previous item and the apps never insert on an update. * core, ui: previous item is optional and has no chat info Events from older remote hosts decode without it; the apps then insert the item if it is not loaded and change no counters. * core: catch-up subscriber gets an edited history post as a new item * ui: updates in another profile do not notify, as on iOS * core, ui: one type for the updated item and its previous version AChatItemUpdate has the chat info, the new item and the previous item with the same chat type and direction. Its JSON is the JSON of AChatItem with an optional prevChatItem; the event keeps the key chatItem. * core: tested event key, previous item reactions, cleared mentions One function renames the event field to chatItem for JSON and docs, and the test checks the wire key and compatibility with AChatItem. The previous item of a direct edit has its reactions. An edit that removes all mentions sends the item without them. * core: test that an edit removing mentions sends the item without them * core: event JSON field mapping inline in the TH options, for the Windows build * core: file chat item update checked in one store transaction * core: test that a file reset by unknown relays sends its previous item * core, ui: chatItemUpdated event key chatItemUpdate * core, ui: chatItemUpdated always has the previous item * ci: mcp scope tests the plugin with its published dependencies * core: mention of the user follows edits of a group message * core: previous item of a prohibited file is read before the prohibition * android, desktop: missed call check inline, counter test with core pairs * ios: spec link of the chatItemUpdated event * core: mention edits in support chats update members requiring attention * core: one rule for the mention of the user in received and edited items * core: record item events of updates for app tests * android, desktop: remove the missed call notification of updates, never shown * android, desktop: test item updates on events recorded by the core * ios: test item updates on events recorded by the core * docs: plan of app tests of item updates, recording tests in the CI guide * core: record the response to an update after its item status is final * ios: notification manager replaceable in tests * ios: test notifications of updates and the update response * android, desktop: test the recorded update response * docs: plan with iOS notifications and the update response * core: recorded response to an update of a sent message
This commit is contained in:
1 parent
dabee7dab8
commit
4eeddce11d
50 files changed
+4641
-184
No files matched your search
@@ -45,7 +45,7 @@ The reduced build runs one Linux job, build-linux (ubuntu-22.04 x86_64), for eve
|
||||
- caches (the steps "Restore ... from cache");
|
||||
- `cabal build -j --enable-tests --ghc-options=-O0` (step "Build CLI");
|
||||
- simplex-chat-test with the selected tests (step "Run tests"), each attempt limited to 35 minutes by `timeout`; an attempt that reaches the limit fails, and "Attempt <n> timed out." is printed.
|
||||
- App test fixtures: core tests write the core's responses that the app tests use to tests/fixtures/api (`/names tests/` to tests/fixtures/api/names, `/contact via address/` to tests/fixtures/api/connect), and fail when a response differs from the committed file; the rewritten files are committed, and the kotlin and ios scopes run for them.
|
||||
- App test fixtures: core tests write the core's responses and events that the app tests use to tests/fixtures/api (`/names tests/` to tests/fixtures/api/names, `/contact via address/` to tests/fixtures/api/connect, `/updated item event has the previous item/`, `/should send updated item with mentions added and removed by edit/` and `/mark call invitation missed when the caller ends the call/` to tests/fixtures/api/updates), and fail when a recording differs from the committed file; the rewritten files are committed, and the kotlin and ios scopes run for them.
|
||||
- Local:
|
||||
```sh
|
||||
cp scripts/cabal.project.local.linux cabal.project.local
|
||||
@@ -134,17 +134,13 @@ The reduced build runs one Linux job, build-linux (ubuntu-22.04 x86_64), for eve
|
||||
|
||||
#### mcp
|
||||
|
||||
- Globs:
|
||||
- packages/simplex-chat-mcp/**
|
||||
- packages/simplex-chat-nodejs/**
|
||||
- packages/simplex-chat-client/types/typescript/**
|
||||
- Globs: packages/simplex-chat-mcp/**.
|
||||
- CI:
|
||||
- in build-linux: `scope-tests.sh mcp` (step "Test changed scopes"):
|
||||
- the types package and the Node.js library built from the branch without the add-on, as package-tests.sh builds them;
|
||||
- `npm ci`, then both installed into the MCP package with `npm install --no-save`;
|
||||
- in build-linux: `scope-tests.sh mcp` (step "Test changed scopes"), with the published `simplex-chat` and `@simplex-chat/types` of package-lock.json:
|
||||
- `npm ci`;
|
||||
- `npx tsc` and `npx tsc -p test/tsconfig.json --noEmit`;
|
||||
- `npm test`, the unit tests;
|
||||
- `npm run test:e2e`, the end-to-end tests. They download libsimplex and the add-on pinned in packages/simplex-chat-nodejs/src/release.ts, and smp-server and xftp-server of the simplexmq release in test/e2e/smpServer.ts;
|
||||
- `npm run test:e2e`, the end-to-end tests. They download libsimplex and the add-on pinned by the installed `simplex-chat`, and smp-server and xftp-server of the simplexmq release in test/e2e/smpServer.ts;
|
||||
- before a publication: the package with its published dependencies, type-checked and unit tested in job `publish` of build.yml (docs/contributing/RELEASES.md, "MCP server release").
|
||||
- Local: `scripts/ci/scope-tests.sh mcp`.
|
||||
|
||||
|
||||
@@ -85,11 +85,7 @@ SCOPE_CHANGES = {
|
||||
"badge-web": ["apps/simplex-badge-service/web/**"],
|
||||
"ci-scripts": ["scripts/ci/packages_release.py", "scripts/ci/test_packages_release.py"],
|
||||
"website": ["website/src/js/simplex-lib.jsc", "website/test/**", "website/package.json"],
|
||||
"mcp": [
|
||||
"packages/simplex-chat-mcp/**",
|
||||
"packages/simplex-chat-nodejs/**",
|
||||
"packages/simplex-chat-client/types/typescript/**",
|
||||
],
|
||||
"mcp": ["packages/simplex-chat-mcp/**"],
|
||||
"support-bot": ["apps/simplex-support-bot/**"],
|
||||
"support-bot-light": ["apps/simplex-support-bot-light/**", "packages/simplex-chat-python/**"],
|
||||
}
|
||||
|
||||
@@ -15,11 +15,8 @@ case "${1:-}" in
|
||||
(cd website && npm test)
|
||||
;;
|
||||
mcp)
|
||||
(cd packages/simplex-chat-client/types/typescript && npm install --no-audit --no-fund && npx tsc)
|
||||
(cd packages/simplex-chat-nodejs && npm install --ignore-scripts --no-save --no-audit --no-fund ../simplex-chat-client/types/typescript && npx tsc && cp src/simplex.* dist)
|
||||
cd packages/simplex-chat-mcp
|
||||
npm ci --no-audit --no-fund
|
||||
npm install --no-save --no-audit --no-fund ../simplex-chat-nodejs ../simplex-chat-client/types/typescript
|
||||
npx tsc
|
||||
npx tsc -p test/tsconfig.json --noEmit
|
||||
npm test
|
||||
|
||||
@@ -526,9 +526,9 @@ class ChangesTest(GitRepoTest):
|
||||
self.assertEqual(self.builds("packages/simplex-chat-mcp/src/tools.ts"), set())
|
||||
self.assertEqual(self.values["scopes"], "mcp")
|
||||
|
||||
def test_library_change_builds_packages_and_tests_the_mcp_scope(self):
|
||||
def test_library_change_builds_packages_without_the_mcp_scope(self):
|
||||
self.assertEqual(self.builds("packages/simplex-chat-nodejs/src/api.ts"), {"packages"})
|
||||
self.assertEqual(self.values["scopes"], "mcp")
|
||||
self.assertEqual(self.values["scopes"], "")
|
||||
|
||||
def test_support_bot_change_tests_its_scope(self):
|
||||
self.assertEqual(self.builds("apps/simplex-support-bot/src/bot.ts"), set())
|
||||
|
||||
Reference in new issue
Block a user