-
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
No browsing history kept on iOS [#5078] #5090
Conversation
branch PR-5090: |
history (:history browser) | ||
history-url (try (nth history history-index) (catch js/Error _)) | ||
new-history (if (not= history-url url) | ||
(conj (subvec history 0 (inc history-index)) |
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.
Worth a separate fn with proper name?
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.
too many params and too small function don't worth it from my pov
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.
Small fns are never an issue :) Mostly useful to understand what this thing is doing. Or maybe a small comment?
(let [browser {:browser-id (random/id) | ||
:name (i18n/label :t/browser) | ||
:history-index 0 | ||
:history [(http/normalize-and-decode-url url)]}] |
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.
Some parts in common with code above. Introduce a fn?
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.
do you mean for creating new browser map?
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.
Right
@@ -64,6 +63,13 @@ | |||
[react/view styles/web-view-loading | |||
[components/activity-indicator {:animating true}]])) | |||
|
|||
(defn on-bridge-message [message browser] | |||
(let [{:strs [type navState]} (js->clj (.parse js/JSON message)) | |||
{:strs [url title]} navState] |
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.
title
not used?
:render-error web-view-error | ||
:render-loading web-view-loading | ||
:on-bridge-message #(on-bridge-message % browser) | ||
;:on-navigation-state-change #(on-navigation-change % browser) |
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.
Remove?
@@ -1,117 +0,0 @@ | |||
(ns status-im.test.models.browser-history |
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.
No more tests?
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.
yeah no model, and now it's super simple code, nothing to test
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 there's much to test browser-back
browser-forward
update-browser-history-tx
, if we don't start adding tests to the codebase (instead of removing them :) ) it makes it harder for everyone to modify and improve it
@@ -1,117 +0,0 @@ | |||
(ns status-im.test.models.browser-history |
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 there's much to test browser-back
browser-forward
update-browser-history-tx
, if we don't start adding tests to the codebase (instead of removing them :) ) it makes it harder for everyone to modify and improve it
[re-frame/trim-v] | ||
(fn [cofx [browser]] | ||
(let [back-index (:history-index browser)] | ||
(when (not (zero? back-index)) |
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.
(when (pos?
?
:browser-nav-forward | ||
[re-frame/trim-v] | ||
(fn [cofx [browser]] | ||
(let [forward-index (:history-index browser)] |
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.
we could destruct browser at params declaration, not a big deal though
(let [{:strs [type navState]} (js->clj (.parse js/JSON message)) | ||
{:strs [url title]} navState] | ||
(when (= type "navStateChange") | ||
(when (not= "about:blank" url) |
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.
might be and
instead of the second when
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.
there will be more types, will be condition
(when-not dapp? | ||
[tooltip/bottom-tooltip-info | ||
(i18n/label :t/browser-warning)])])) | ||
(let [can-go-back? (not (zero? history-index)) |
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.
again, can we use pos?
here? or index can be negative?
[react/touchable-highlight {:on-press #(re-frame/dispatch [:browser-nav-forward browser]) | ||
:disabled (not can-go-forward?) | ||
:style (merge styles/forward-button | ||
(when (not can-go-forward?) styles/disabled-button)) |
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.
when-not
7a2a093
to
d44e4cd
Compare
@jeluard @cammellos done! |
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 thanks!
branch PR-5090: |
d44e4cd
to
cab5c4d
Compare
branch PR-5090: |
81% of end-end tests have passed
Failed tests (12)Click to expand
Passed tests (52)Click to expand
|
Builds apk https://i.diawi.com/qyRJgF and ipa https://i.diawi.com/CNoPMe has been tested on iOS (11.2.5) and Andorid (6.0, 7.0) @flexsurfer, few issues we faced here: I) Those Dapps which kept the browsing history fine on iOS before (e.g. Etheremons, CryptoPunks) AND webpages (like google.com / wikipedia.org) - does not keep browsing history not only on iOS but on Android as well now.
II) No browsing history cut off when user navigates to any link from the middle of his browsing history. It becomes a bit confusing for where browser navigates then. See the scenario:
III) On the Home page screen any Dapp/web page has instead of the actual last visited URL the 'Dapp' labels TF session showing all three issues above: https://app.testfairy.com/projects/4803622-status/builds/8518521/sessions/4395906530/?accessToken=vP/BJVyUO/qs6g8pUdSj7vkIwc4 |
cab5c4d
to
f3662e6
Compare
thanks @Serhy , fixed |
f3662e6
to
63efadb
Compare
branch PR-5090: |
88% of end-end tests have passed
Failed tests (9)Click to expand
Passed tests (63)Click to expand
|
@flexsurfer latest changes look really good! We keep the history now on iOS and Android app browsers for Dapps/websites and I was able to navigate through history with Back/Fwd browser buttons! However, there are issues we need to look at:
TF session from 01:00 https://app.testfairy.com/projects/4803622-status/builds/8521278/sessions/4396102337/?accessToken=ayUtWG7xTPNwdt5g8TCNi1zkS8g
Note: iOS app browser it looks good here. On latest nightly I could not reproduce the same issue with the steps above (no auto-return back when I don't touch anything), but browser history for OpenSea looks a bit weird on nightly develop build as well - just need to navigate between summary/detail screens of this Dapp a bit more. (I'm OK if consider to fix it separately off this PR changes) |
63efadb
to
059c56e
Compare
branch PR-5090: |
059c56e
to
871e871
Compare
@Serhy fixed |
branch PR-5090: |
branch PR-5090: |
All above issues are fixed! Thanks a lot @flexsurfer! Lets merge! |
Signed-off-by: Andrey Shovkoplyas <[email protected]>
871e871
to
a644075
Compare
76% of end-end tests have passed
Failed tests (9)Click to expand
Passed tests (29)Click to expand
|
fixes #5078