Commit Graph

8138 Commits

Author SHA1 Message Date
Icaro Motta a17efa7299
Make json-rpc/call effect more in line with re-frame standards (#15936)
Changes effect :json/rpc-call to accept on-success and on-error parameters
either as functions OR as re-frame event vectors. The changes are 100% backwards
compatible.

## Why?

Re-frame is very explicit in its documentation and its architecture, saying that
event handlers should be pure. Calling re-frame.core/dispatch in event handlers
makes them sort of stateful.

> So, you can "get away with it". But it ain't pure.
>
> -- https://day8.github.io/re-frame/EffectfulHandlers/#90-solution

In status-mobile, arguably one of our most important effects (not to be confused
with event handlers) is :json-rpc/call, but at the moment, the on-success and
on-error values are expected to be stateful functions (e.g. usually used for
logging and dispatching subsequent events).

This creates two important problems:

1. The value returned by event handlers is more opaque and cannot be easily
   inspected (for example using tap>, log/debug or just println). If we try to
   inspect or log them, on-success and on-error will be printed as
   #object[Function].
2. Testing event handlers using :json-rpc/call becomes an exercise of
   frustration, because we can't simply compare the results of the event handler
   with a good expected value, which is one of the big selling points of testing
   pure functions.

### The testability of event handlers

> For any re-frame app, there's three things to test:
>
> - Event Handlers - most of your testing focus will be here because this is
>   where most of the logic lives
> - Subscription Handlers - often not a lot to test here. Only Layer 3
>   subscriptions need testing.
> - View functions - I don't tend to write tests for views.
>
> -- https://day8.github.io/re-frame/Testing/#what-to-test

So re-frame is saying event handlers should be pure, and that event handlers
should be tested.

In order to achieve the divine simplicity of testing event handlers as pure
functions, we need to make :json-rpc/call also accept on-success and
on-error as event vectors.

Good news is that there is a known pattern to solve this problem, e.g. used by
the library https://github.com/Day8/re-frame-http-fx.

The pattern is simple once we see it: behind the scenes, :json-rpc/call conj'es
the results of the RPC call into the event vectors on-success and on-error, and
:json-rpc/call dispatches the events itself. This eliminates the need for the
stateful dispatch call in event handlers.
2023-05-18 15:56:10 -03:00
frank c7bc16608a
fix #15899 : failed to reset password (#15914)
* fix #15899 

4cc53630...080d8ad3

* update status-go-version.json

* update status-go-version.json
2023-05-18 22:30:27 +08:00
Mohamed Javid 3c9ad509cd
[Fix] Activity Center Empty Community Icons (#15907)
Signed-off-by: Mohamed Javid <19339952+smohamedjavid@users.noreply.github.com>
2023-05-18 16:38:18 +05:30
Siddarth Kumar eea55b22d7
Dont check `app-state` for `Android` when evaluating universal links routing (#15896)
* Dont check app-state for android before routing PN

On Android devices, right after account creation and before a log out, the :app-state value in reframe db is set to background. The value becomes active after a log out and then log in which causes tapping on push notifications to do nothing.

This behaviour breaks E2E and hence in this PR, I remove the checking of this case only for Android platforms.
More work should be done to figure out why the app state event handler is behaving this way on Android but for now I would like to unblock E2E.

* e2e: remove xfailed tests

---------

Co-authored-by: Churikova Tetiana <tatiana@status.im>
2023-05-18 00:20:38 +05:30
Andrea Maria Piana 7efd1e5d6b
Bump status-go version to 0.151.8 2023-05-17 18:24:42 +01:00
Omar Basem b264d25b69
fix: composer opacity (#15929) 2023-05-17 19:43:42 +04:00
Omar Basem 03f501ca7b
fix: image flicker (#15932) 2023-05-17 15:52:23 +04:00
Ulises Manuel Cárdenas 6598873343
[#15779] Disable input and buttons while loggin in 2023-05-17 00:13:10 -06:00
Siddarth Kumar a60235abf3
(feat) : add share capabilities in shell (#15782)
fixes: #13439

Summary
- Update `quo2/qr-code` component to use `fast-image` instead of `rn/image`
- Adds profile tab in share section, wallet tab is marked as WIP
- Shows profile QR code along with link to user's profile and the user's emoji hash.
- profile link is shareable and copyable on tap.
- emoji hash is shareable and copyable on tap.
- fixed weird android issues
2023-05-16 21:57:34 +05:30
flexsurfer b5a8f0a127
[15611] Lock orientation (#15915) 2023-05-16 16:54:21 +02:00
Mohamed Javid 7d0dfec22c
Design Feedbacks on "Create profile password" screen (#15863)
Signed-off-by: Mohamed Javid <19339952+smohamedjavid@users.noreply.github.com>
Co-authored-by: pavloburykh <pavlo@status.im>
2023-05-16 18:03:45 +05:30
Mohamed Javid 51fa99affa
Add Accessiblity for Image Container in Chat (#15913)
Signed-off-by: Mohamed Javid <19339952+smohamedjavid@users.noreply.github.com>
2023-05-16 17:27:02 +05:30
codemaster 369aed389c
feat: new keycard component (#15892) 2023-05-16 13:37:14 +02:00
Jakub Sokołowski 10d9c34559
ci: fix Alchemy and Infura env vars for iOS
Signed-off-by: Jakub Sokołowski <jakub@status.im>
2023-05-16 13:06:37 +02:00
Jakub Sokołowski 8ccf2d1596
ci: fix missing Alchemy and Infura env vars
Depends on:
https://github.com/status-im/status-jenkins-lib/pull/65

Signed-off-by: Jakub Sokołowski <jakub@status.im>
2023-05-16 11:20:29 +02:00
Churikova Tetiana 7ef466078a
e2e: image test 2023-05-15 19:08:03 +02:00
Jamie Caprani 4b2d62ee1f
chore: update ui for syncing page for onboarding and in profile (#15623) 2023-05-15 10:07:13 -07:00
flexsurfer 05073e7453
fix onboarding transition background color (#15900) 2023-05-15 16:28:08 +02:00
frank fa11c232cc
update status-go-version.json (#15894) 2023-05-15 20:41:26 +08:00
Brian Sztamfater 3038ceeb82
fix: audio issue when sending app to background on Android and other fixes
Signed-off-by: Brian Sztamfater <brian@status.im>
2023-05-15 09:19:06 -03:00
frank d2e38772b9
use debounce-and-dispatch to improve mention performance (#15887)
* use debounce-and-dispatch to improve mention performance

* increase time to 400ms

* decrease time to 300ms

* update status-go-version.json

* update status-go-version.json
2023-05-15 15:51:29 +08:00
Churikova Tetiana 409c0a9e60
e2e: small fixes 2023-05-12 14:25:32 +02:00
erikseppanen 4b98f0e8de
Add 'How to scan' syncing screens (#15710) 2023-05-11 20:58:57 -04:00
Omar Basem 264b7ffab9
Fix mentions animation when disappearing (#15879)
* fix: suggestions list animation
2023-05-11 22:33:25 +04:00
Alexander c71224e73e
Double-tap for communities & fix for 'Recent' tab not being shown as selected if message icon is double tapped (#15844)
* Updates

* Small namespace fix
2023-05-11 18:17:50 +02:00
Parvesh Monu 3c278ed06c
fix window height sub leak (#15878) 2023-05-11 19:57:37 +05:30
Jamie Caprani d714dc1590
chore: restore label on im new to status page (#15876) 2023-05-11 07:09:03 -07:00
Ajay Sivan d2840885dd
fix: app locked screen accent color (#15854) 2023-05-11 05:31:41 -07:00
Omar Basem 87247af86b
Composer polishing (#15875)
* composer polishing
2023-05-11 15:35:42 +04:00
Mohamed Javid 159ad02e7a
[Fix] Tapable area of user avatar in chat (#15840) 2023-05-11 14:33:35 +05:30
Alexander ce322c9537
Remove identicons, replace them with initials of a user (#15815)
* Remove identicon, replace it with initials of a user

* Lint fix
2023-05-11 10:05:20 +02:00
Omar Basem 13a1ee7479
Fix composer max height on some Android devices (#15871)
* fix: android keyboard height
2023-05-11 11:41:53 +04:00
yqrashawn c1f24fb1bb
feat: doc info boxes while onboarding (#15697) 2023-05-11 10:00:36 +08:00
Parvesh Monu 4afe251086
Show correct error message while unlocking app (#15845) 2023-05-11 02:29:52 +05:30
Jakub Sokołowski ac3eb3e660
nix: use SRI hashes for Gradle dependencies
This way we will use the same format as Nix logs and errors when a hash
changes, which avoids confusion.

Signed-off-by: Jakub Sokołowski <jakub@status.im>
2023-05-10 15:45:32 +02:00
Omar Basem 638ec98db5
fix: maximized composer incorrect bottom padding (#15865)
* fix: maximized composer incorrect bottom padding
2023-05-10 17:36:44 +04:00
Jakub Sokołowski 78131c1028
ci: add Alchemy and Infura credentials in CI
Depends on: https://github.com/status-im/status-jenkins-lib/pull/64

Signed-off-by: Jakub Sokołowski <jakub@status.im>
2023-05-10 12:57:04 +02:00
Volodymyr Kozieiev 5655efa448
Separate doc with debug tips (#15849)
Debugging basics
2023-05-10 10:38:59 +01:00
Jakub Sokołowski c008c01bc1
ci: bump timeout for tests to 15 minutes
We've been seing longer runs on release CI for nightlies, possibly due
to more than 2 parallel builds running on one host.

Signed-off-by: Jakub Sokołowski <jakub@status.im>
2023-05-10 11:06:10 +02:00
Omar Basem 7e1af5b80d
Composer polishing (#15857)
* refactor: composer
2023-05-10 12:17:24 +04:00
Ulises Manuel Cárdenas ee4bcf9116
Recovery phrase onboarding (#15831)
* Add missing tests for recovery phrase input
2023-05-09 21:55:09 -06:00
Ajay Sivan 1aff364595
fix: android blur view hash mismatch in some locations 2023-05-09 21:36:12 +02:00
Alexander 929ec6a453
'Unpin' option in 1-1 chat for deleted message (#15833) 2023-05-09 19:27:10 +02:00
Omar Basem 341497e98d
feat: new composer complete 🎉 (#15818)
* feat: new composer
2023-05-09 21:03:19 +04:00
frank c275205bed
Adapt to status-go backend changes for ConvertToKeycardAccount (#15846) 2023-05-09 20:51:08 +08:00
Parvesh Monu ebb110e6e3
fix Home-stack overlaps bottom tabs in Xiaomi devices on first run (#15821) 2023-05-09 16:03:13 +05:30
Ibrahem Khalil ab973076eb
[15612] Only allow showing universal links after clicking start using status (#15786) 2023-05-09 10:49:25 +03:00
Volodymyr Kozieiev c78bdda717
Last message preview improvings (#15613) 2023-05-08 18:37:26 +01:00
Jakub Sokołowski b7a138118a
nix: update Gradle dependencies
Contains changes that should have been included in:
https://github.com/status-im/status-mobile/pull/15713

Signed-off-by: Jakub Sokołowski <jakub@status.im>
2023-05-08 16:22:18 +02:00
Jakub Sokołowski f03e11c877
nix: fix handling POMs without JARs
Otherwise we can get a failure like this:
```
Regenerating Nix files...
Found 40 sub-projects...
Found 609 direct dependencies...
Found 889 dependency URLs...
 ! Failed to fetch: https://repo.maven.apache.org/maven2/org/ow2/asm/asm-bom/9.5/asm-bom-9.5.jar
```
When using `make nix-update-gradle`.

Signed-off-by: Jakub Sokołowski <jakub@status.im>
2023-05-08 15:48:19 +02:00