Skip to content

Commit

Permalink
Merge branch 'develop' into milad/16334
Browse files Browse the repository at this point in the history
  • Loading branch information
mmilad75 committed Jul 25, 2023
2 parents 939ccde + 9aafe61 commit 35d7a3c
Show file tree
Hide file tree
Showing 12 changed files with 74 additions and 33 deletions.
9 changes: 4 additions & 5 deletions .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
name: Bug Report
about: Bug Report
name: MVPBug Report
about: MVPBug Report
title: ''
labels: bug
labels: E:MobileBugfixesMVP
assignees: ''

---
Expand All @@ -22,8 +22,7 @@ assignees: ''

### Reproduction

1) Open Status
2)
1.

### Additional Information

Expand Down
30 changes: 30 additions & 0 deletions .github/ISSUE_TEMPLATE/wont-fix-bug.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
name: Wont fix Report
about: to facilitate future handling, identify and address non-urgent issues that won't be prioritized in the near future
title: ''
labels: likely_wont_fix
assignees: ''

---

## Problem


#### Expected behavior


#### Actual behavior


### Reproduction

1.

### Additional Information

- Status version: release
- Operating System: Android, iOS


[comment]: # (Please, add logs/notes if necessary)

Original file line number Diff line number Diff line change
Expand Up @@ -626,10 +626,10 @@ public void migrateKeyStoreDir(final String accountData, final String password)
}

@ReactMethod
public void loginWithKeycard(final String accountData, final String password, final String chatKey) {
public void loginWithKeycard(final String accountData, final String password, final String chatKey, final String nodeConfigJSON) {
Log.d(TAG, "loginWithKeycard");
this.migrateKeyStoreDir(accountData, password);
String result = Statusgo.loginWithKeycard(accountData, password, chatKey);
String result = Statusgo.loginWithKeycard(accountData, password, chatKey, nodeConfigJSON);
if (result.startsWith("{\"error\":\"\"")) {
Log.d(TAG, "LoginWithKeycard result: " + result);
} else {
Expand Down
5 changes: 3 additions & 2 deletions modules/react-native-status/ios/RCTStatus/RCTStatus.m
Original file line number Diff line number Diff line change
Expand Up @@ -633,14 +633,15 @@ - (void) migrateKeystore:(NSString *)accountData

RCT_EXPORT_METHOD(loginWithKeycard:(NSString *)accountData
password:(NSString *)password
chatKey:(NSString *)chatKey) {
chatKey:(NSString *)chatKey
nodeConfigJSON:(NSString *)nodeConfigJSON) {
#if DEBUG
NSLog(@"LoginWithKeycard() method called");
#endif
[self getExportDbFilePath];
[self migrateKeystore:accountData password:password];

NSString *result = StatusgoLoginWithKeycard(accountData, password, chatKey);
NSString *result = StatusgoLoginWithKeycard(accountData, password, chatKey, nodeConfigJSON);

NSLog(@"%@", result);
}
Expand Down
11 changes: 9 additions & 2 deletions modules/react-native-status/nodejs/status.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1041,7 +1041,7 @@ void _LoginWithKeycard(const FunctionCallbackInfo<Value>& args) {
Isolate* isolate = args.GetIsolate();
Local<Context> context = isolate->GetCurrentContext();

if (args.Length() != 3) {
if (args.Length() != 4) {
// Throw an Error that is passed back to JavaScript
isolate->ThrowException(Exception::TypeError(
String::NewFromUtf8Literal(isolate, "Wrong number of arguments for LoginWithKeycard")));
Expand All @@ -1065,6 +1065,11 @@ void _LoginWithKeycard(const FunctionCallbackInfo<Value>& args) {
String::NewFromUtf8Literal(isolate, "Wrong argument type for 'keyHex'")));
return;
}
if (!args[3]->IsString()) {
isolate->ThrowException(Exception::TypeError(
String::NewFromUtf8Literal(isolate, "Wrong argument type for 'nodeConfigJSON'")));
return;
}


String::Utf8Value arg0Obj(isolate, args[0]->ToString(context).ToLocalChecked());
Expand All @@ -1073,9 +1078,11 @@ void _LoginWithKeycard(const FunctionCallbackInfo<Value>& args) {
char *arg1 = *arg1Obj;
String::Utf8Value arg2Obj(isolate, args[2]->ToString(context).ToLocalChecked());
char *arg2 = *arg2Obj;
String::Utf8Value arg3Obj(isolate, args[3]->ToString(context).ToLocalChecked());
char *arg3 = *arg3Obj;

// Call exported Go function, which returns a C string
char *c = LoginWithKeycard(arg0, arg1, arg2);
char *c = LoginWithKeycard(arg0, arg1, arg2, arg3);

Local<String> ret = String::NewFromUtf8(isolate, c).ToLocalChecked();
args.GetReturnValue().Set(ret);
Expand Down
4 changes: 2 additions & 2 deletions src/native_module/core.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -225,12 +225,12 @@
(.verifyDatabasePassword ^js (status) key-uid hashed-password callback))

(defn login-with-keycard
[{:keys [key-uid multiaccount-data password chat-key]}]
[{:keys [key-uid multiaccount-data password chat-key node-config]}]
(log/debug "[native-module] login-with-keycard")
(clear-web-data)
(init-keystore
key-uid
#(.loginWithKeycard ^js (status) multiaccount-data password chat-key)))
#(.loginWithKeycard ^js (status) multiaccount-data password chat-key (types/clj->json node-config))))

(defn set-soft-input-mode
[mode]
Expand Down
2 changes: 1 addition & 1 deletion src/status_im/keycard/real_keycard.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@

(defn login
[args]
(native-module/login-with-keycard args))
(native-module/login-with-keycard (assoc args :node-config {:ProcessBackedupMessages false})))

(defn send-transaction-with-signature
[{:keys [transaction signature on-completed]}]
Expand Down
3 changes: 2 additions & 1 deletion src/status_im/keycard/recovery.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,8 @@
encryption-pass
#(let [{:keys [error]} (types/json->clj %)]
(if (string/blank? error)
(native-module/login-with-keycard login-params)
(native-module/login-with-keycard
(assoc login-params :node-config {:ProcessBackedupMessages true}))
(throw
(js/Error.
"Please shake the phone to report this error and restart the app. Migration failed unexpectedly.")))))))
Expand Down
6 changes: 3 additions & 3 deletions status-go-version.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"_comment": "Instead use: scripts/update-status-go.sh <rev>",
"owner": "status-im",
"repo": "status-go",
"version": "v0.162.5",
"commit-sha1": "cf2d72bfa83f094719a93b7b7fd5a68e3a68ab47",
"src-sha256": "0x79nm1n6gbgz2lzsky29laap7m0r0hggrb2fsn07bf0xw0364qn"
"version": "v0.162.9",
"commit-sha1": "6085a05f77354a26d879f476e67aa85cac1e1414",
"src-sha256": "0lb87lnfi49fk7ijppppr79rzkg8xzpwb3xxxmmq6wca2nb1pqp5"
}
3 changes: 1 addition & 2 deletions test/appium/tests/critical/test_public_chat_browsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -937,8 +937,7 @@ def test_community_contact_block_unblock_offline(self):

@marks.testrail_id(703086)
def test_community_mark_all_messages_as_read(self):
self.channel_1.click_system_back_button_until_element_is_shown()
self.home_1.communities_tab.click()
self.home_1.jump_to_communities_home()
self.channel_2.click_system_back_button_until_element_is_shown()
self.home_2.communities_tab.click()
self.home_2.get_chat(self.community_name, community=True).click()
Expand Down
5 changes: 3 additions & 2 deletions test/appium/tests/medium/test_activity_center.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ def test_activity_center_contact_request_decline(self):
self.home_2.jump_to_messages_home()
self.home_2.open_activity_center_button.click()
self.home_2.activity_unread_filter_button.click()
if not self.home_2.element_by_text_part(self.home_2.get_translation_by_key("add-me-to-your-contacts")).is_element_displayed(30):
if not self.home_2.element_by_text_part(
self.home_2.get_translation_by_key("add-me-to-your-contacts")).is_element_displayed(30):
self.errors.append(
"Pending contact request is not shown on unread notification element on Activity center!")
self.home_2.close_activity_centre.click()
Expand Down Expand Up @@ -96,7 +97,7 @@ def test_activity_center_contact_request_accept_swipe_mark_all_as_read(self):
self.home_1.just_fyi("Check that can accept contact request from read notifications")
self.home_1.activity_unread_filter_button.click()
cr_element.swipe_right_on_element()
self.home_1.activity_notification_swipe_button.click()
self.home_1.activity_notification_swipe_button.click_inside_element_by_coordinate(rel_x=0.5, rel_y=0.5)
self.home_1.close_activity_centre.click()
self.home_1.contacts_tab.click()
if not self.home_1.contact_details_row(username=self.username_2).is_element_displayed(20):
Expand Down
25 changes: 14 additions & 11 deletions test/appium/views/sign_in_view.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
from selenium.common.exceptions import NoSuchElementException
import base64
import os

from selenium.common.exceptions import NoSuchElementException

from tests import common_password, appium_root_project_path
from tests.base_test_case import AbstractTestCase
from views.base_element import Button, EditBox, Text
from views.base_view import BaseView
import base64
from tests.base_test_case import AbstractTestCase


class MultiAccountButton(Button):
class Username(Text):
Expand Down Expand Up @@ -122,7 +125,8 @@ def navigate(self):
class UserProfileElement(Button):
def __init__(self, driver, username):
self.username = username
super().__init__(driver, xpath="//*[@text='%s']//ancestor::android.view.ViewGroup[@content-desc='profile-card']" % username)
super().__init__(driver,
xpath="//*[@text='%s']//ancestor::android.view.ViewGroup[@content-desc='profile-card']" % username)

def open_user_options(self):
Button(self.driver, xpath='%s//*[@content-desc="profile-card-options"]' % self.locator).click()
Expand Down Expand Up @@ -197,9 +201,9 @@ def __init__(self, driver):
self.start_button = Button(self.driver, accessibility_id="welcome-button")
self.use_recovery_phrase_button = Button(self.driver, translation_id="use-recovery-phrase")
self.passphrase_edit_box = EditBox(self.driver, accessibility_id="passphrase-input")
self.show_profiles_button = Button(self.driver, accessibility_id="show-profiles")
self.plus_profiles_button = Button(self.driver, accessibility_id="show-new-account-options")
self.create_new_profile_button = Button(self.driver, accessibility_id="create-new-profile")
self.show_profiles_button = Button(self.driver, accessibility_id="show-profiles")
self.plus_profiles_button = Button(self.driver, accessibility_id="show-new-account-options")
self.create_new_profile_button = Button(self.driver, accessibility_id="create-new-profile")
self.remove_profile_button = Button(self.driver, accessibility_id="remove-profile")

def set_password(self, password: str):
Expand All @@ -225,7 +229,7 @@ def create_user(self, password=common_password, keycard=False, enable_notificati
self.generate_keys_button.click_until_presence_of_element(self.profile_your_name_edit_box)
self.set_profile(username)
self.set_password(password)
if self.enable_biometric_maybe_later_button.is_element_displayed(30):
if self.enable_biometric_maybe_later_button.is_element_displayed(10):
self.enable_biometric_maybe_later_button.click()
# self.next_button.click_until_absense_of_element(self.element_by_translation_id("intro-wizard-title2"))
# if keycard:
Expand Down Expand Up @@ -262,7 +266,8 @@ def recover_access(self, passphrase: str, password: str = common_password, keyca
self.continue_button.click_until_presence_of_element(self.profile_your_name_edit_box)
self.set_profile(username, set_image)
self.set_password(password)
self.enable_biometric_maybe_later_button.wait_and_click(30)
if self.enable_biometric_maybe_later_button.is_element_displayed(10):
self.enable_biometric_maybe_later_button.click()
self.identifiers_button.wait_and_click(30)
if enable_notifications:
self.enable_notifications_button.click_until_presence_of_element(self.start_button)
Expand Down Expand Up @@ -347,5 +352,3 @@ def get_user(self, username):
self.driver.info("Getting username card by '%s'" % username)
expected_element = UserProfileElement(self.driver, username)
return expected_element if expected_element.is_element_displayed(10) else self.driver.fail("User is not found!")


0 comments on commit 35d7a3c

Please sign in to comment.