-
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
[ISSUE #2287] Push Notifications: Use status-go NotifyUsers instead of Notify #2902
[ISSUE #2287] Push Notifications: Use status-go NotifyUsers instead of Notify #2902
Conversation
@pombeirp Can we also make sure it ends up correctly on receiving end? Or make it possible for QA to check with grep on device logs. I.e.: Client A (status-react) -> status-go (trigger notification -> Firebase -> Client B (status-react) console logs. Receiving side: https://github.com/status-im/status-react/blob/develop/src/status_im/utils/notifications.cljs#L36-L47 (TODO can probably be removed now btw) |
It'd be great if we can let QA test without requiring this change, either if we can get above end to end to work with existing status-go version, or if we issue PR to status-go with your temp change + make custom build + bump status-go dep temp in this PR. Former is probably easier I think but open to both, WDYT? |
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.
Minor comments and some testing notes
@oskarth I added a screenshot of the receiving app on the OP above. If seeing that on their test device is enough for QA, then we could just go with the existing go version without changes. Otherwise I can try to do the change and bump the dependencies. I'll take a look at the |
@oskarth Strange, I'm not seeing the |
Hm, not sure. I know I had to install some special stuff on Genymotion to get notifications to work, but seems like you actually received the notification so doesn't seem to be that. Maybe it is a log stream problem? Also, if you resolve conflicts, let's move this to testing. Either QA (with TestFairy) or I can have a look then. Requesting sanity review from @rasom concurrently as it touches Java/iOS interface stuff. |
Thanks @oskarth. Do you want me to point this to a special |
If it isn't logged by default in normal status-go, that'd be great! If you push a branch/PR you should be able to use https://jenkins.status.im/job/status-go-manual/ job to get a version on form |
@oskarth I'll test the build I generated today and let you know if it is ready for QA. |
@oskarth I don't know why I stopped seeing the log entries for |
It's really hard to read, but the map after cond-> gets threaded into the (assoc...) form as first part. In the original line it goes reg-fx :send-notification used to take:
where m isn't present because it is threaded from above. NOTE: note tested, just written in GH, but something like this. Can also put this in a |
@@ -84,8 +84,8 @@ | |||
(defn should-move-to-internal-storage? [callback] | |||
(module-interface/-should-move-to-internal-storage? rns-module callback)) | |||
|
|||
(defn notify [token callback] | |||
(module-interface/-notify rns-module token callback)) | |||
(defn notify-users [message payload tokens callback] |
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.
Consider doing same interface change here as ::send-notification above, i.e. [{:keys [message payload tokens] :as m} callback]
as arg
^ nudge @rasom review as well. |
@@ -18,7 +18,7 @@ dependencies { | |||
compile 'com.github.ericwlange:AndroidJSCore:3.0.1' | |||
compile 'status-im:function:0.0.1' | |||
|
|||
String statusGoVersion = 'develop-gd71c66a2' | |||
String statusGoVersion = 'junk-log-NotifyUsers-g605a2123-62' |
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.
can't we use current status-go
's develop
here?
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.
This is just a temporary commit to gain additional logging on the go side to allow QA to verify.
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.
Tentatively approve, same comment as above, but let's test this and get it merged soon. PR getting a bit old and would prefer to keep velocity up.
@oskarth I think the |
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.
by request
OK @oskarth I think we're ready to go. Results from |
Automated test results: |
Automated test results:test_password[logcat]:white_check_mark::Test Steps & Error message:
test_password[mismatch]:white_check_mark::Test Steps & Error message:
test_group_chat_members:x:Test Steps & Error message:
test_sign_in[invalid]:white_check_mark::Test Steps & Error message:
test_sign_in[valid]:white_check_mark::Test Steps & Error message:
test_commands_on_second_app_run:x:Test Steps & Error message:
test_group_chat_send_receive_messages_and_remove_user:x:Test Steps & Error message:
test_change_user_name:white_check_mark::Test Steps & Error message:
test_recover_access:white_check_mark::Test Steps & Error message:
test_send_funds_via_request[one_to_one_chat]:x:Test Steps & Error message:
test_send_funds_via_request[group_chat]:x:Test Steps & Error message:
test_request_transaction_from_wallet:x:Test Steps & Error message:
test_eth_and_currency_balance:white_check_mark::Test Steps & Error message:
test_send_transaction_from_wallet[sign_later]:x:Test Steps & Error message:
test_wallet_error_messages:white_check_mark::Test Steps & Error message:
test_one_to_one_chat:x:Test Steps & Error message:
test_transaction_send_command[group_chat]:x:Test Steps & Error message:
test_send_transaction_from_wallet[sign_now]:x:Test Steps & Error message:
test_transaction_send_command[wrong_password]:x:Test Steps & Error message:
test_send_transaction_from_daap:x:Test Steps & Error message:
test_password[short]:white_check_mark::Test Steps & Error message:
test_transaction_send_command[one_to_one_chat]:x:Test Steps & Error message:
|
Automated test results:test_send_transaction_from_daap:white_check_mark::Test Steps & Error message:
test_send_eth_from_wallet_sign_later:white_check_mark::Test Steps & Error message:
test_transaction_send_command_group_chat:white_check_mark::Test Steps & Error message:
test_send_stt_from_wallet_via_enter_contact_code:white_check_mark::Test Steps & Error message:
test_send_eth_from_wallet_sign_now:x:Test Steps & Error message:
test_send_eth_to_request_from_wallet:x:Test Steps & Error message:
test_send_eth_to_request_in_group_chat:white_check_mark::Test Steps & Error message:
test_transaction_send_command_wrong_password:white_check_mark::Test Steps & Error message:
|
@annadanchenko do you think we can get this tested? I know it is low-priority, but it's been in test for 20 days now and it's the third time I've had to solve merge conflicts to keep it testable. |
@pombeirp and again a merge conflict sorry :D |
Automated test results:test_browse_link_entering_url_in_dapp_view:x:Test Steps & Error message:
test_contact_profile_view:white_check_mark::Test Steps & Error message:
test_qr_code_and_its_value:white_check_mark::Test Steps & Error message:
test_network_switch:white_check_mark::Test Steps & Error message:
test_send_eth_from_wallet_sign_now:white_check_mark::Test Steps & Error message:
test_transaction_send_command_wrong_password: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_send_stt_from_wallet_via_enter_contact_code:white_check_mark::Test Steps & Error message:
test_transaction_send_command_group_chat:white_check_mark::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_from_wallet:white_check_mark::Test Steps & Error message:
test_send_eth_to_request_in_group_chat:x:Test Steps & Error message:
|
Can get notification if send a message in 1:1 chat to the added contact (both iOs and Android)
|
@pombeirp please squash commits |
@flexsurfer Done |
Signed-off-by: Andrey Shovkoplyas <motor4ik@gmail.com>
Fixes #2287
Summary:
This PR updates the react-side code to use
Statusgo.NotifyUsers(message, payloadJSON, tokensArray *C.char)
instead ofStatusgo.Notify(token *C.char)
.Review notes:
I've made some temporary changes to logging code and set the payload to some bogus data, so this should be reset before merging to
develop
.Testing notes:
In order to test that the unencrypted payload has arrived correctly to the Go side, I changed the following code in
geth/api/api.go
on my machine:You need to make sure that the
LOG_LEVEL_STATUS_GO
feature flag is set to at leastwarn
level.Steps to test:
adb logcat | grep -e ReactNativeJS -e notifyUsers -e send-notification -e NotifyUsers -e StatusModule
You should see something similar to the following:
There's initially the call to
send-notification
on the CLJS side, then the fakeWARN
log message on thegeth
side, and then the success callback result appearing back on the CLJS side (send-notification cb result: {"status":true}
).On the receiving device, you can see the title and content that come from the CLJS code:
status: ready