Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Albums): Fix extra count of messages for image albums #10023

Merged
merged 1 commit into from
Apr 3, 2023

Conversation

borismelnik
Copy link
Contributor

@borismelnik borismelnik commented Mar 24, 2023

Fixes: #9958

status-go pr

What does the PR do

Skip extra count of new messages for image albums

Affected areas

Chat

StatusQ checklist

  • add documentation if necessary (new component, new feature)
  • update sandbox app
    • in case of new component, add new component page
    • in case of new features, add variation to existing component page
    • nice to have: add it to the demo application as well
  • test changes in both light and dark theme?

Screenshot of functionality (including design for comparison)

Снимок экрана 2023-03-24 в 20 41 36

@borismelnik borismelnik requested review from a team, alaibe, MishkaRogachev, glitchminer and jrainville and removed request for a team March 24, 2023 17:42
@status-im-auto
Copy link
Member

status-im-auto commented Mar 24, 2023

Jenkins Builds

Click to see older builds (38)
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ a3de6f4 #1 2023-03-24 17:48:15 ~5 min tests-nim 📄log
✔️ a3de6f4 #1 2023-03-24 17:48:26 ~5 min imports 📄log
✔️ a3de6f4 #1 2023-03-24 17:51:34 ~9 min macos 🍎dmg
✔️ a3de6f4 #1 2023-03-24 17:54:21 ~11 min linux 📦tgz
✖️ a3de6f4 #1 2023-03-24 18:03:40 ~21 min linux-e2e 📄log
✔️ a3de6f4 #1 2023-03-24 18:16:16 ~33 min windows 💿exe
✔️ efa296c #2 2023-03-27 14:49:02 ~7 min macos 🍎dmg
✔️ efa296c #2 2023-03-27 14:49:34 ~7 min imports 📄log
✔️ efa296c #2 2023-03-27 14:52:00 ~10 min tests-nim 📄log
✔️ efa296c #2 2023-03-27 14:55:12 ~13 min linux 📦tgz
✖️ efa296c #2 2023-03-27 15:02:50 ~21 min linux-e2e 📄log
✔️ efa296c #2 2023-03-27 15:13:45 ~31 min windows 💿exe
✔️ 6e27703 #3 2023-03-27 18:43:17 ~5 min tests-nim 📄log
✔️ 6e27703 #3 2023-03-27 18:44:01 ~6 min imports 📄log
✔️ 6e27703 #3 2023-03-27 18:45:10 ~7 min macos 🍎dmg
✔️ 6e27703 #3 2023-03-27 18:49:03 ~11 min linux 📦tgz
✖️ 6e27703 #3 2023-03-27 18:55:44 ~18 min linux-e2e 📄log
✔️ 6e27703 #3 2023-03-27 19:02:48 ~25 min windows 💿exe
✔️ fe56218 #4 2023-03-29 15:52:19 ~6 min imports 📄log
✔️ fe56218 #4 2023-03-29 15:52:50 ~6 min tests-nim 📄log
✔️ fe56218 #4 2023-03-29 15:54:42 ~8 min macos 🍎dmg
✔️ fe56218 #4 2023-03-29 15:59:27 ~13 min linux 📦tgz
✖️ fe56218 #4 2023-03-29 16:06:32 ~20 min linux-e2e 📄log
✔️ fe56218 #4 2023-03-29 16:16:27 ~30 min windows 💿exe
✔️ edec9ba #5 2023-03-30 13:38:51 ~9 min macos 🍎dmg
✔️ edec9ba #5 2023-03-30 13:42:50 ~13 min tests-nim 📄log
✔️ edec9ba #5 2023-03-30 13:42:51 ~13 min imports 📄log
✔️ edec9ba #5 2023-03-30 13:46:12 ~16 min linux 📦tgz
✖️ edec9ba #5 2023-03-30 13:49:13 ~20 min linux-e2e 📄log
✔️ edec9ba #5 2023-03-30 14:11:33 ~42 min windows 💿exe
✖️ edec9ba #6 2023-03-30 14:41:07 ~16 min linux-e2e 📄log
✔️ cd622c1 #6 2023-03-30 15:07:52 ~6 min tests-nim 📄log
✔️ cd622c1 #6 2023-03-30 15:08:27 ~7 min imports 📄log
✔️ cd622c1 #6 2023-03-30 15:08:36 ~7 min macos 🍎dmg
✔️ cd622c1 #6 2023-03-30 15:13:36 ~12 min linux 📦tgz
✖️ cd622c1 #7 2023-03-30 15:15:21 ~13 min linux-e2e 📄log
✔️ cd622c1 #6 2023-03-30 15:27:03 ~25 min windows 💿exe
✔️ cd622c1 #8 2023-03-30 16:01:49 ~14 min linux-e2e 📄log
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ c051322 #7 2023-03-31 16:27:47 ~5 min tests-nim 📄log
✔️ c051322 #7 2023-03-31 16:28:31 ~6 min imports 📄log
✔️ c051322 #7 2023-03-31 16:30:22 ~8 min macos 🍎dmg
✔️ c051322 #7 2023-03-31 16:31:42 ~9 min linux 📦tgz
✔️ c051322 #9 2023-03-31 16:36:13 ~14 min linux-e2e 📄log
✔️ c051322 #7 2023-03-31 16:48:21 ~26 min windows 💿exe
✔️ 296e89e #8 2023-04-03 10:19:20 ~5 min tests-nim 📄log
✔️ 296e89e #8 2023-04-03 10:20:24 ~6 min imports 📄log
✔️ 296e89e #8 2023-04-03 10:21:57 ~8 min macos 🍎dmg
✔️ 296e89e #8 2023-04-03 10:23:39 ~9 min linux 📦tgz
✖️ 296e89e #10 2023-04-03 10:28:10 ~14 min linux-e2e 📄log
✔️ 296e89e #8 2023-04-03 10:44:31 ~30 min windows 💿exe
✔️ 296e89e #11 2023-04-03 11:35:25 ~15 min linux-e2e 📄log

@anastasiyaig
Copy link
Contributor

@borismelnik it seems i cant create an account in this branch

Screenshot 2023-03-29 at 17 28 32

ERR 2023-03-29 17:28:26.124+03:00 login error                                topics="app-controller" tid=6661357 file=module.nim:419 methodName=onNodeLogin errDesription="failed to apply migrations: failed to apply status-go/protocol migrations: failed to migrate: no such column: album_id in line 0: CREATE TABLE IF NOT EXISTS chats (\n  id VARCHAR PRIMARY KEY ON CONFLICT REPLACE,\n  name VARCHAR NOT NULL,\n  color VARCHAR NOT NULL DEFAULT \'#a187d5\',\n  type INT NOT NULL,\n  active BOOLEAN NOT NULL DEFAULT TRUE,\n  timestamp INT NOT NULL,\n  deleted_at_clock_value INT NOT NULL DEFAULT 0,\n  public_key BLOB,\n  unviewed_message_count INT NOT NULL DEFAULT 0,\n  last_clock_value INT NOT NULL DEFAULT 0,\n  last_message BLOB,\n  members BLOB,\n  membership_updates BLOB\n);\n\nCREATE TABLE contacts (\n  id TEXT PRIMARY KEY ON CONFLICT REPLACE,\n  address TEXT NOT NULL,\n  name TEXT NOT NULL,\n  ens_verified BOOLEAN DEFAULT FALSE,\n  ens_verified_at INT NOT NULL DEFAULT 0,\n  alias TEXT NOT NULL,\n  identicon TEXT NOT NULL,\n  photo TEXT NOT NULL,\n  last_updated INT NOT NULL DEFAULT 0,\n  system_tags BLOB,\n  device_info BLOB,\n  tribute_to_talk TEXT NOT NULL\n);\n\n-- It\'s important that this table has rowid as we rely on it\n-- when implementing infinite-scroll.\nCREATE TABLE IF NOT EXISTS user_messages (\n    id VARCHAR PRIMARY KEY ON CONFLICT REPLACE,\n    whisper_timestamp INTEGER NOT NULL,\n    source TEXT NOT NULL,\n    destination BLOB,\n    text VARCHAR NOT NULL,\n    content_type INT NOT NULL,\n    username VARCHAR,\n    timestamp INT NOT NULL,\n    chat_id VARCHAR NOT NULL,\n    local_chat_id VARCHAR NOT NULL,\n    hide BOOLEAN DEFAULT FALSE,\n    response_to VARCHAR,\n    message_type INT,\n    clock_value INT NOT NULL,\n    seen BOOLEAN NOT NULL DEFAULT FALSE,\n    outgoing_status VARCHAR,\n    parsed_text BLOB,\n    raw_payload BLOB,\n    sticker_pack INT,\n    sticker_hash VARCHAR,\n    command_id VARCHAR,\n    command_value VARCHAR,\n    command_address VARCHAR,\n    command_from VARCHAR,\n    command_contract VARCHAR,\n    command_transaction_hash VARCHAR,\n    command_signature BLOB,\n    command_state INT\n);\n\nCREATE INDEX idx_album_id on user_messages(local_chat_id, album_id);\nCREATE INDEX idx_source ON user_messages(source);\nCREATE INDEX idx_search_by_chat_id ON  user_messages(\n    substr(\'0000000000000000000000000000000000000000000000000000000000000000\' || clock_value, -64, 64) || id, chat_id, hide\n);\n\nCREATE TABLE IF NOT EXISTS raw_messages (\n  id VARCHAR PRIMARY KEY ON CONFLICT REPLACE,\n  local_chat_id VARCHAR NOT NULL,\n  last_sent INT NOT NULL,\n  send_count INT NOT NULL,\n  sent BOOLEAN DEFAULT FALSE,\n  resend_automatically BOOLEAN DEFAULT FALSE,\n  message_type INT,\n  recipients BLOB,\n  payload BLOB);\n\nCREATE TABLE IF NOT EXISTS messenger_transactions_to_validate (\n  message_id VARCHAR,\n  command_id VARCHAR NOT NULL,\n  transaction_hash VARCHAR PRIMARY KEY,\n  retry_count INT,\n  first_seen INT,\n  signature BLOB NOT NULL,\n  to_validate BOOLEAN DEFAULT TRUE,\n  public_key BLOB);\n\nCREATE INDEX idx_messenger_transaction_to_validate ON  messenger_transactions_to_validate(to_validate);\n"

the same in autotests here: https://ci.status.im/job/status-desktop/job/branches/job/e2e/job/PR-10023/3/squishResults_230327_184231.764/server_230327_185137.649.log

@borismelnik
Copy link
Contributor Author

@borismelnik it seems i cant create an account in this branch

Screenshot 2023-03-29 at 17 28 32
ERR 2023-03-29 17:28:26.124+03:00 login error                                topics="app-controller" tid=6661357 file=module.nim:419 methodName=onNodeLogin errDesription="failed to apply migrations: failed to apply status-go/protocol migrations: failed to migrate: no such column: album_id in line 0: CREATE TABLE IF NOT EXISTS chats (\n  id VARCHAR PRIMARY KEY ON CONFLICT REPLACE,\n  name VARCHAR NOT NULL,\n  color VARCHAR NOT NULL DEFAULT \'#a187d5\',\n  type INT NOT NULL,\n  active BOOLEAN NOT NULL DEFAULT TRUE,\n  timestamp INT NOT NULL,\n  deleted_at_clock_value INT NOT NULL DEFAULT 0,\n  public_key BLOB,\n  unviewed_message_count INT NOT NULL DEFAULT 0,\n  last_clock_value INT NOT NULL DEFAULT 0,\n  last_message BLOB,\n  members BLOB,\n  membership_updates BLOB\n);\n\nCREATE TABLE contacts (\n  id TEXT PRIMARY KEY ON CONFLICT REPLACE,\n  address TEXT NOT NULL,\n  name TEXT NOT NULL,\n  ens_verified BOOLEAN DEFAULT FALSE,\n  ens_verified_at INT NOT NULL DEFAULT 0,\n  alias TEXT NOT NULL,\n  identicon TEXT NOT NULL,\n  photo TEXT NOT NULL,\n  last_updated INT NOT NULL DEFAULT 0,\n  system_tags BLOB,\n  device_info BLOB,\n  tribute_to_talk TEXT NOT NULL\n);\n\n-- It\'s important that this table has rowid as we rely on it\n-- when implementing infinite-scroll.\nCREATE TABLE IF NOT EXISTS user_messages (\n    id VARCHAR PRIMARY KEY ON CONFLICT REPLACE,\n    whisper_timestamp INTEGER NOT NULL,\n    source TEXT NOT NULL,\n    destination BLOB,\n    text VARCHAR NOT NULL,\n    content_type INT NOT NULL,\n    username VARCHAR,\n    timestamp INT NOT NULL,\n    chat_id VARCHAR NOT NULL,\n    local_chat_id VARCHAR NOT NULL,\n    hide BOOLEAN DEFAULT FALSE,\n    response_to VARCHAR,\n    message_type INT,\n    clock_value INT NOT NULL,\n    seen BOOLEAN NOT NULL DEFAULT FALSE,\n    outgoing_status VARCHAR,\n    parsed_text BLOB,\n    raw_payload BLOB,\n    sticker_pack INT,\n    sticker_hash VARCHAR,\n    command_id VARCHAR,\n    command_value VARCHAR,\n    command_address VARCHAR,\n    command_from VARCHAR,\n    command_contract VARCHAR,\n    command_transaction_hash VARCHAR,\n    command_signature BLOB,\n    command_state INT\n);\n\nCREATE INDEX idx_album_id on user_messages(local_chat_id, album_id);\nCREATE INDEX idx_source ON user_messages(source);\nCREATE INDEX idx_search_by_chat_id ON  user_messages(\n    substr(\'0000000000000000000000000000000000000000000000000000000000000000\' || clock_value, -64, 64) || id, chat_id, hide\n);\n\nCREATE TABLE IF NOT EXISTS raw_messages (\n  id VARCHAR PRIMARY KEY ON CONFLICT REPLACE,\n  local_chat_id VARCHAR NOT NULL,\n  last_sent INT NOT NULL,\n  send_count INT NOT NULL,\n  sent BOOLEAN DEFAULT FALSE,\n  resend_automatically BOOLEAN DEFAULT FALSE,\n  message_type INT,\n  recipients BLOB,\n  payload BLOB);\n\nCREATE TABLE IF NOT EXISTS messenger_transactions_to_validate (\n  message_id VARCHAR,\n  command_id VARCHAR NOT NULL,\n  transaction_hash VARCHAR PRIMARY KEY,\n  retry_count INT,\n  first_seen INT,\n  signature BLOB NOT NULL,\n  to_validate BOOLEAN DEFAULT TRUE,\n  public_key BLOB);\n\nCREATE INDEX idx_messenger_transaction_to_validate ON  messenger_transactions_to_validate(to_validate);\n"

the same in autotests here: https://ci.status.im/job/status-desktop/job/branches/job/e2e/job/PR-10023/3/squishResults_230327_184231.764/server_230327_185137.649.log

I'll take a look. Maybe something wrong or its just not updated yet.

@anastasiyaig anastasiyaig self-requested a review March 29, 2023 14:38
@anastasiyaig
Copy link
Contributor

oh my bad, i saw 2 approvals and assumed it is ready to be tested. If it is not the case - please lemme know so i can test it when it is time :)

@borismelnik borismelnik force-pushed the fix/issue-9958-badge-count branch 3 times, most recently from edec9ba to cd622c1 Compare March 30, 2023 15:01
@glitchminer
Copy link
Contributor

glitchminer commented Mar 31, 2023

Hi @borismelnik , what's the scope of this please? I'm seeing a message count of 1 in chat navigation, group chat badge, and system notification but still a count of 5 in activity centre.

Additionally, I still cannot clear the count after reading the message.

image

@borismelnik
Copy link
Contributor Author

Hi @borismelnik , what's the scope of this please? I'm seeing a message count of 1 in chat navigation, group chat badge, and system notification but still a count of 5 in activity centre.

Additionally, I still cannot clear the count after reading the message.

image

Hi @glitchminer ! Unfortunately, activity center notifications is another issue. I will check what is wrong with counter.

@borismelnik
Copy link
Contributor Author

@glitchminer try this version, I add the correct last unseen message detection if message include in album. It works for me.

Copy link
Contributor

@glitchminer glitchminer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fixes @borismelnik.
Tested, approved.

@borismelnik borismelnik merged commit 0302b79 into master Apr 3, 2023
@borismelnik borismelnik deleted the fix/issue-9958-badge-count branch April 3, 2023 11:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Messaging: Skip extra count from new messages badge for albums
7 participants