-
Notifications
You must be signed in to change notification settings - Fork 987
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
[refs #3210] Replace realm reads for chats with app-db reads #3225
Conversation
Let me first resolve the conflicts. |
src/status_im/chat/events/input.cljs
Outdated
@@ -477,8 +477,7 @@ | |||
(handlers/register-handler-fx | |||
:send-current-message | |||
[(re-frame/inject-cofx :random-id) | |||
(re-frame/inject-cofx :get-last-clock-value) | |||
(re-frame/inject-cofx :get-stored-chat)] | |||
(re-frame/inject-cofx :get-last-clock-value)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i thought we removed :get-last-clock-value
, @janherich ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@flexsurfer it will be removed after i merge develop
Found bug with public chats - create new pub chat, send message to it, got:
UPD: it only happens in this PR, not in current develop. |
@dmitryn That bug should not happen on develop |
@janherich right, i'm just logging it here to remember myself to fix it. |
ea9ab0a
to
3c406b2
Compare
Re-opening, was accidentally closed while merging conflicts with develop branch |
@janherich @flexsurfer it's ready for review after develop has been merged. Please take a look. |
src/status_im/chat/handlers.cljs
Outdated
@@ -172,14 +172,15 @@ | |||
:added-to-at timestamp | |||
:timestamp timestamp | |||
:is-active true} | |||
exists? (chats/exists? group-id)] | |||
(when (or (not exists?) (chats/new-update? timestamp group-id)) | |||
exists? (not (nil? chat))] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically, (nil? chat)
is not necessary and (not chat)
will work just as good, but minor point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@janherich ok, i'll get rid of exists?
binding at all, because (if chat)
reads as clear as (if exists?)
src/status_im/data_store/chats.cljs
Outdated
set | ||
(set/intersection identities) | ||
seq | ||
boolean))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems quite complicated for simple membership test, won't fn signature [contacts identity]
and body:
((into #{} (map :identity) contacts) identity)
Work just as well ?
Also because it's a simple helper function used just in the protocol.handlers
ns, I would define it there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@janherich good point. Set is indeed can be used as function for membership test. Will change that.
@janherich i'm also thinking if It's being used in 2 other namespaces: chat/handlers and protocol/handlers so i cannot simply move it to both. Maybe move it to |
@dmitryn I think |
please, ignore e2e tests failures above, all of them are using old 'add contact flow', new flow will be added today |
9d71e91
to
8d26de0
Compare
Commits have been squashed. |
@flexsurfer Are you happy with the changes? Can we move it forward? |
@goranjovic sure |
@dmitryn conflicts :) |
f711b4e
to
6e95026
Compare
Conflicts have been resolved. |
@dmitryn I've tested it and so far it looks good. Could you rebase this branch so I could run end-end tests on the most up to date version of the build? |
6e95026
to
8a5ebd3
Compare
Automated test results:test_send_eth_from_wallet_sign_now:x:Test Steps & Error message:
test_browse_link_entering_url_in_dapp_view:white_check_mark::Test Steps & Error message:
test_contact_profile_view:x:Test Steps & Error message:
test_one_to_one_chat_messages_and_delete_chat:x:Test Steps & Error message:
test_transaction_send_command_wrong_password:white_check_mark::Test Steps & Error message:
test_send_stt_from_wallet_via_enter_recipient_address:white_check_mark::Test Steps & Error message:
test_send_eth_from_wallet_sign_later:white_check_mark::Test Steps & Error message:
test_send_transaction_from_daap:white_check_mark::Test Steps & Error message:
test_network_switch:white_check_mark::Test Steps & Error message:
test_transaction_send_command_group_chat:white_check_mark::Test Steps & Error message:
test_group_chat_messages:white_check_mark::Test Steps & Error message:
test_public_chat:x:Test Steps & Error message:
test_transaction_send_command_one_to_one_chat:x:Test Steps & Error message:
test_send_eth_to_request_in_one_to_one_chat:white_check_mark::Test Steps & Error message:
test_send_eth_to_request_in_group_chat:white_check_mark::Test Steps & Error message:
test_send_eth_to_request_from_wallet:white_check_mark::Test Steps & Error message:
|
Signed-off-by: Andrey Shovkoplyas <motor4ik@gmail.com>
8a5ebd3
to
8abdd77
Compare
Addresses #3210
This second part of ongoing work, part 1 is here #3212
Summary:
Replace realm read for chats data with app-db read as we don't need to touch realm since data is already in app-db.
Review notes:
This is part of further work at #3210
Testing notes:
App behavior should not change. Code changed related to interactions with the chats:
status: ready