Skip to content

issue #576 mix local and cloud contacts in search results#716

Merged
tomholub merged 4 commits intomasterfrom
feature/issue-576-contacts-mix
Oct 21, 2021
Merged

issue #576 mix local and cloud contacts in search results#716
tomholub merged 4 commits intomasterfrom
feature/issue-576-contacts-mix

Conversation

@sosnovsky
Copy link
Collaborator

@sosnovsky sosnovsky commented Oct 20, 2021

This PR shows local contacts along with remote ones when autocompleting recipients on compose screen.

close #576


Tests (delete all except exactly one):

  • Difficult to test (explain why) - uses Realm

To be filled by reviewers

I have reviewed that this PR... (tick whichever items you personally focused on during this review):

  • addresses the issue it closes (if any)
  • code is readable and understandable
  • is accompanied with tests, or tests are not needed
  • is free of vulnerabilities
  • is documented clearly and usefully, or doesn't need documentation

@sosnovsky sosnovsky requested a review from tomholub October 20, 2021 10:52
Copy link
Collaborator

@tomholub tomholub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code looks good, will test

@tomholub
Copy link
Collaborator

This will later need a ui test, something like:

  1. search a string in compose, see results
  2. manually add two public keys in contacts - one matching, one not
  3. search a string again in compose view, the results should newly contain the matching added public key on top

@tomholub
Copy link
Collaborator

I got some logs when trying to search recipient, not sure if it was present previously?

2021-10-20 13:29:49.876025+0200 FlowCrypt[3250:1107898] Writing analzed variants.
2021-10-20 13:29:49.880282+0200 FlowCrypt[3250:1107898] Writing analzed variants.
2021-10-20 13:29:52.174626+0200 FlowCrypt[3250:1107898] The behavior of the UICollectionViewFlowLayout is not defined because:
2021-10-20 13:29:52.174665+0200 FlowCrypt[3250:1107898] the item width must be less than the width of the UICollectionView minus the section insets left and right values, minus the content insets left and right values.
2021-10-20 13:29:52.174912+0200 FlowCrypt[3250:1107898] The relevant UICollectionViewFlowLayout instance is <UICollectionViewFlowLayout: 0x13bfbfd80>, and it is attached to <ASCollectionView: 0x13c931800; baseClass = UICollectionView; frame = (8 0; 304 44.3333); clipsToBounds = YES; gestureRecognizers = <NSArray: 0x283641260>; layer = <ASCollectionNode-Layer: 0x282daf880; node = <ASCollectionNode: 0x13c967000>>; contentOffset: {0, 0}; contentSize: {304, 0}; adjustedContentInset: {0, 0, 0, 0}; layout: <UICollectionViewFlowLayout: 0x13bfbfd80>; dataSource: <ASCollectionViewProxy: 0x283e0d2c0>>.
2021-10-20 13:29:52.174932+0200 FlowCrypt[3250:1107898] Make a symbolic breakpoint at UICollectionViewFlowLayoutBreakForInvalidSizes to catch this in the debugger.
2021-10-20 13:29:53.023901+0200 FlowCrypt[3250:1108080] [tcp] tcp_input [C1.1:3] flags=[R] seq=2760919664, ack=0, win=0 state=LAST_ACK rcv_nxt=2760919664, snd_una=2281143250
2021-10-20 13:29:53.191459+0200 FlowCrypt[3250:1107898] Failed to scroll to item at index path (null) because the item never reached the view.
2021-10-20 13:29:53.284105+0200 FlowCrypt[3250:1107898] The behavior of the UICollectionViewFlowLayout is not defined because:
2021-10-20 13:29:53.284145+0200 FlowCrypt[3250:1107898] the item width must be less than the width of the UICollectionView minus the section insets left and right values, minus the content insets left and right values.
2021-10-20 13:29:53.284236+0200 FlowCrypt[3250:1107898] The relevant UICollectionViewFlowLayout instance is <UICollectionViewFlowLayout: 0x13d242070>, and it is attached to <ASCollectionView: 0x13c855200; baseClass = UICollectionView; frame = (8 0; 304 44.3333); clipsToBounds = YES; gestureRecognizers = <NSArray: 0x28366d1d0>; layer = <ASCollectionNode-Layer: 0x282db48c0; node = <ASCollectionNode: 0x13d888000>>; contentOffset: {0, 0}; contentSize: {304, 0}; adjustedContentInset: {0, 0, 0, 0}; layout: <UICollectionViewFlowLayout: 0x13d242070>; dataSource: <ASCollectionViewProxy: 0x283e20d80>>.
2021-10-20 13:29:53.284257+0200 FlowCrypt[3250:1107898] Make a symbolic breakpoint at UICollectionViewFlowLayoutBreakForInvalidSizes to catch this in the debugger.

@tomholub
Copy link
Collaborator

Also there seems to be some race condition problem: if I type tom@flowcrypt.com slowly, let's say I managed to write tom@f it will cut me off and evaluate the result. Since tom@f is not a valid email, it will show in red.

@tomholub
Copy link
Collaborator

image

@sosnovsky
Copy link
Collaborator Author

I reproduced your issue with tom@f, but don't have these UICollectionViewFlowLayout logs in console during search - what iOS version are you using for testing?

@tomholub
Copy link
Collaborator

It needs to be able to evaluate what I'm typing without interrupting the input. Offer suggestions, but don't break my flow. Please update it in this PR too as it's making it hard to even send an email.

@sosnovsky
Copy link
Collaborator Author

Ah, I see on screenshot, probably it happens on small screen sizes, will check

@tomholub
Copy link
Collaborator

I reproduced your issue with tom@f, but don't have these UICollectionViewFlowLayout logs in console during search - what iOS version are you using for testing?

15.0.1. It's offering me a 15.0.2 update but haven't updated yet.

@tomholub
Copy link
Collaborator

I have a 12 mini.

@tomholub
Copy link
Collaborator

tomholub commented Oct 20, 2021

Actually, before writing a ui test for anything more specific, we should have one purely for being able to type and choose any of the recipient suggestions - which should catch situation like the one that happened to me - I'll file an issue.

@sosnovsky
Copy link
Collaborator Author

@tomholub I fixed typing issue and also updated recipient cell layout to remove mentioned UICollectionViewFlowLayout warnings, should work well now

Copy link
Collaborator

@tomholub tomholub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works well. Thanks!

@tomholub tomholub merged commit c75fdfc into master Oct 21, 2021
@tomholub tomholub deleted the feature/issue-576-contacts-mix branch October 21, 2021 08:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mix local contacts into remote contacts to render on compose view

2 participants