Skip to content
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

[feature] Note To Self #569

Open
wants to merge 20 commits into
base: dev
Choose a base branch
from

Conversation

EdGeraghty
Copy link
Collaborator

@EdGeraghty EdGeraghty commented Feb 15, 2022

Types

  • Fix (non-breaking change which fixes an issue)
  • Feature (non-breaking change which adds functionality)
  • Refactor (non-breaking change which improves code quality - QA thoroughly )
  • Breaking Change (fix or feature that would cause existing functionality to not work as expected)
  • Chore (updates that would not affect or change the code involving the app itself)

Changes

🔮 Features

Notes to Self

🐛 Fixes

🔒 Security

🛠 Performance

📐 Refactoring

Media (if applicable)

QA

  • Signup
  • Login
  • Logout
  • Unencrypted Chat
  • Encrypted Chat
  • Group Chats
  • Profile Changes
  • Theming Changes
  • Force Kill and Restart

Final Checklist

  • All associated issues have been linked to PR
  • All necessary changes made to the documentation
  • Parties interested in these changes have been notified

@EdGeraghty EdGeraghty requested a review from ereio February 15, 2022 18:36
@EdGeraghty EdGeraghty added approved Current description and details of feature have been approved for dev by core team feature New feature or request UI/UX View only feature wip Not ready to merge labels Feb 15, 2022
@EdGeraghty EdGeraghty mentioned this pull request Feb 15, 2022
Copy link
Collaborator Author

@EdGeraghty EdGeraghty left a comment

Choose a reason for hiding this comment

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

flutter: [🌎 Easy Localization] [DEBUG] Build
flutter: [🌎 Easy Localization] [DEBUG] Init Localization Delegate
flutter: [🌎 Easy Localization] [DEBUG] Init provider
flutter: [🌎 Easy Localization] [DEBUG] Load Localization Delegate
flutter: [🌎 Easy Localization] [DEBUG] Load asset from assets/translations
flutter: [🌎 Easy Localization] [DEBUG] Load asset from assets/translations
flutter: [media] loaded 0
flutter: [initStore] persistor saving from SetOlmAccount
flutter: [initStore] persistor saving from SetDeviceKeysOwned
flutter: [syncObserver] running sync
flutter: [fetchSync] *** starting sync *** 
flutter: createHttpClient() - cert already trusted! Skipping.
flutter: [updateOneTimeKeyCounts] {signed_curve25519: 35}, current {signed_curve25519: 35}
flutter: [syncObserver] running sync
flutter: [fetchSync] *** starting sync *** 
flutter: createHttpClient() - cert already trusted! Skipping.
flutter: [syncObserver] still syncing
flutter: [syncObserver] still syncing
flutter: [parseSync] !UVfspReCNKmqemGPlZ:geraghty.london limited true lastBatch false prevBatch true
flutter: [syncRooms] Empty Chat full_synced: true limited: false total new messages: 0 roomPrevBatch: s147361_12212344_4663_212358_8049_9_1968_488751_1
flutter: [initStore] persistor saving from SetRoom
flutter: [updateOneTimeKeyCounts] {signed_curve25519: 35}, current {signed_curve25519: 35}
flutter: [toggleDirectRoom] Account data not found
flutter: [syncRooms] Note to Self full_synced: true limited: false total new messages: 0 roomPrevBatch: s147361_12212344_4663_212358_8049_9_1968_488751_1
flutter: [initStore] persistor saving from SetRoom
flutter: [initStore] persistor saving from SetRoom
flutter: createHttpClient() - cert already trusted! Skipping.
flutter: [syncObserver] running sync
flutter: [fetchSync] *** starting sync *** 
flutter: [syncRooms] Note to Self full_synced: true limited: false total new messages: 0 roomPrevBatch: t1-147360_0_0_0_0_0_0_0_0
flutter: createHttpClient() - cert already trusted! Skipping.
flutter: [parseSync] !UVfspReCNKmqemGPlZ:geraghty.london limited false lastBatch false prevBatch true
flutter: [syncRooms] Note to Self full_synced: true limited: false total new messages: 0 roomPrevBatch: s147362_12212344_4663_212358_8049_9_1968_488751_1
flutter: [initStore] persistor saving from SetRoom
flutter: [syncObserver] still syncing
flutter: [initStore] persistor saving from SetRoom
flutter: [updateOneTimeKeyCounts] {signed_curve25519: 35}, current {signed_curve25519: 35}
flutter: [syncObserver] running sync
flutter: [fetchSync] *** starting sync *** 
flutter: createHttpClient() - cert already trusted! Skipping.
flutter: [syncObserver] still syncing
flutter: [syncObserver] still syncing
flutter: [sendTyping] typing indicators disabled
flutter: [syncObserver] still syncing
flutter: [claimOneTimeKeys] all key sharing sessions per device are ready
flutter: [loadKeySessionOutbound] checking outbounds for /L3LKf+xndwccTHRrADDPJ+M8s9ixfn5MG/aNQzoJjU
flutter: [loadKeySessionOutbound] found mm4XMVCtlS/droRSSu9yEVk4Se60BIpdnqQGpGfkaFs for /L3LKf+xndwccTHRrADDPJ+M8s9ixfn5MG/aNQzoJjU of type 0
flutter: [loadKeySessionOutbound] checking outbounds for Jq4UBW9A+vYuEHYU/3q87rs+eKSG4/B0gW+UMTB4DXs
flutter: [loadKeySessionOutbound] found IH9lsrA/fbgeWxb1BLh6bQaE9iqRYRMNFFF6arwtmEQ for Jq4UBW9A+vYuEHYU/3q87rs+eKSG4/B0gW+UMTB4DXs of type 0
flutter: [loadKeySessionOutbound] checking outbounds for 9Zw8kLtAKBDgmmId7huJ4/guY2D8nRWPRFasMp8T/wo
flutter: [loadKeySessionOutbound] found XU+Jd6iPYVYpTXyNh5cMxf6ESzp1Hi1Vx8pk4Oykjsg for 9Zw8kLtAKBDgmmId7huJ4/guY2D8nRWPRFasMp8T/wo of type 0
flutter: [loadKeySessionOutbound] checking outbounds for htTpjuaJe0FvyHQ3YWl+2oHwBQJ2pNUmUvNNBYbwo08
flutter: [loadKeySessionOutbound] found G68XN2FhgtAMfk+gvHLBWtMADdayrAHiq0kFQgin4QE for htTpjuaJe0FvyHQ3YWl+2oHwBQJ2pNUmUvNNBYbwo08 of type 0
flutter: [loadKeySessionOutbound] checking outbounds for l695NaXBcdagrk48oB0MhvrOxu6rONTMAU9hNu4/R0A
flutter: [loadKeySessionOutbound] found Qhs4dAyVnI2YQoQcLa4MynYHfWCgE4A+MCIQj9dsu0M for l695NaXBcdagrk48oB0MhvrOxu6rONTMAU9hNu4/R0A of type 0
flutter: [loadKeySessionOutbound] checking outbounds for DczLY/nYiAbekZBYCeH104bRX6ORvoARi4JUWvUO3Aw
flutter: [loadKeySessionOutbound] found zsEjLFsnCHx4dv66Qb3ZW76hlRyqOyTeokAbGgsAJrU for DczLY/nYiAbekZBYCeH104bRX6ORvoARi4JUWvUO3Aw of type 0
flutter: [loadKeySessionOutbound] checking outbounds for 4UZmI73L3pu6U9NoUo4XRjEtUhY8AreNsHe6TT9Vwyw
flutter: [loadKeySessionOutbound] found 7kIY02/lk2tfaED1B7Eex9sI8eyenIbwKSto+ZQcZF0 for 4UZmI73L3pu6U9NoUo4XRjEtUhY8AreNsHe6TT9Vwyw of type 0
flutter: [loadKeySessionOutbound] checking outbounds for li01zcxEp1uLain2F+K1sQwoYtVr9Kmu90cwVxayckc
flutter: [loadKeySessionOutbound] found eWS1H2sAfRjHR1uJluGW2zwvGME02YlC8egSHf6eVZU for li01zcxEp1uLain2F+K1sQwoYtVr9Kmu90cwVxayckc of type 0
flutter: [loadKeySessionOutbound] checking outbounds for SuRvu6j0qpGjWXXIsUi93mmltiX0nj0qKS32u83qmCc
flutter: [loadKeySessionOutbound] found 4QTQ0G+xGvrcVAW97CYrL3NXyGlEQib+WlpXYRYZQxY for SuRvu6j0qpGjWXXIsUi93mmltiX0nj0qKS32u83qmCc of type 0
flutter: [initStore] persistor saving from SaveKeySession
flutter: [initStore] persistor saving from SaveKeySession
flutter: [initStore] persistor saving from SaveKeySession
flutter: [initStore] persistor saving from SaveKeySession
flutter: [initStore] persistor saving from SaveKeySession
flutter: [initStore] persistor saving from SaveKeySession
flutter: [initStore] persistor saving from SaveKeySession
flutter: [initStore] persistor saving from SaveKeySession
flutter: [initStore] persistor saving from SaveKeySession
flutter: [sendSessionKeys] success! 2036539858
flutter: [sendSessionKeys] success! 1175466330
flutter: [sendSessionKeys] success! 1922827214
flutter: [sendSessionKeys] success! 1474527561
flutter: [sendSessionKeys] success! 704602701
flutter: [sendSessionKeys] success! 2123870775
flutter: [sendSessionKeys] success! 1746299933
flutter: [sendSessionKeys] success! 2066904403
flutter: [sendSessionKeys] success! 1322305846
flutter: [syncObserver] still syncing
flutter: [parseSync] !UVfspReCNKmqemGPlZ:geraghty.london limited false lastBatch false prevBatch true
flutter: [syncRooms] Note to Self full_synced: true limited: false total new messages: 1 roomPrevBatch: s147369_12212344_4663_212358_8049_9_1977_488751_1
flutter: [decryptMessage] Unable to find inbound message session for decryption
flutter: [initStore] persistor saving from SetRoom

For some reason I can't decrypt messages in a Note to Self DM room

@ereio
Copy link
Member

ereio commented Feb 16, 2022

very strange, i'll take a look. I have a feeling it's some code block associated with sending keys properly only when another non-currentUser is in the room.

@EdGeraghty
Copy link
Collaborator Author

Interestingly, it's also unable to decrypt messages sent by Element, although Element is perfectly happy with the room as configured. It's something to do with loadMessageSessionInbound, but I'm just chasing my tail in circles haha

@EdGeraghty
Copy link
Collaborator Author

I've logged out and back in, and suddenly these rooms work as expected 🤦‍♂️

@ereio
Copy link
Member

ereio commented Feb 21, 2022

@EdGeraghty can you pull the latest changes from dev? Want to see if it changes anything; it affects messageSessionInbound keys.

@EdGeraghty
Copy link
Collaborator Author

@ereio I have rebased on Dev and all seems good

image

@ereio ereio changed the title Feature/note to self [feature] Note To Self Feb 22, 2022
@ereio
Copy link
Member

ereio commented Feb 22, 2022

not sure what happened with this merge but it looks like it's attempting to recommit previous work?

would you mind rebase your changes on top of dev instead? Happy to attempt doing it as well

@EdGeraghty EdGeraghty force-pushed the feature/note-to-self branch 2 times, most recently from 589902d to d604583 Compare February 22, 2022 10:26
@EdGeraghty EdGeraghty removed the approved Current description and details of feature have been approved for dev by core team label Mar 1, 2022
@ereio
Copy link
Member

ereio commented Mar 18, 2022

let me know if/when you'd like me to take a look at this!

@EdGeraghty
Copy link
Collaborator Author

Yes - sorry, I got a little lost in the best way to implement the room avatar and then got sidetracked on other stuff.

@EdGeraghty EdGeraghty force-pushed the feature/note-to-self branch from d604583 to e599ae0 Compare March 30, 2022 18:27
@EdGeraghty
Copy link
Collaborator Author

I've rebased this and it's still working as expected. The last step is to work out how to set the room avatar - is this a good/silly approach so far?

@EdGeraghty EdGeraghty force-pushed the feature/note-to-self branch from e599ae0 to 21bd3e7 Compare April 19, 2022 06:59
@EdGeraghty
Copy link
Collaborator Author

image

As you can see, I'm very close but the Avatar Widget is throwing an AppState error which is what ends up being set haha

@EdGeraghty EdGeraghty added the help wanted Extra attention is needed label Apr 20, 2022
@EdGeraghty
Copy link
Collaborator Author

image
I've only gone and done it...!

@EdGeraghty EdGeraghty added ready for review ready for review or merging and removed help wanted Extra attention is needed wip Not ready to merge labels Apr 20, 2022
@EdGeraghty EdGeraghty marked this pull request as ready for review April 20, 2022 13:06
@EdGeraghty EdGeraghty self-assigned this Apr 20, 2022
@EdGeraghty
Copy link
Collaborator Author

EdGeraghty commented Apr 20, 2022

Fixes #560

Copy link
Member

@ereio ereio left a comment

Choose a reason for hiding this comment

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

Great work @EdGeraghty !

I'd like to make sure a few things are handled properly before merging. Have you tested what happens when a user searches themselves again after they've created a Note To Self? Does it automatically navigate them there like existing user DMs?

inviteIds.whereNot((userId) => userId == currentUser.userId).toList();

final isNoteToSelf =
inviteIds.length == 1 && inviteIds.single == currentUser.userId;
Copy link
Member

Choose a reason for hiding this comment

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

good form on this line. It's a one liner, but it's easy to read

final List<User> latestUsers = List.from(users.values.take(25));

if (!latestUsers.any((user) => user.userId == currentUser.userId)) {
latestUsers.insert(0, currentUser);
Copy link
Member

Choose a reason for hiding this comment

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

it's picky, but you could use a .sort() here instead to just move the current user to the front without the if

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That only works if the user's in the list to begin with though, right?

final screenshotController = ScreenshotController();
final avatar = MemoryFileSystem().file('avatar.png');

await screenshotController
Copy link
Member

@ereio ereio Apr 20, 2022

Choose a reason for hiding this comment

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

Ignore the previous message, I just realized the Icon is an asset. You should be able to convert this to a bytestream without taking a screenshot. I can push something in a branch to help with this

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thank you. It has been driving me nuts how to get it out of its SVG

@dnisbetjones
Copy link
Contributor

image

I think this looks excellent Ed! Well done!

@EdGeraghty
Copy link
Collaborator Author

EdGeraghty commented Apr 20, 2022

Great work @EdGeraghty !

I'd like to make sure a few things are handled properly before merging. Have you tested what happens when a user searches themselves again after they've created a Note To Self? Does it automatically navigate them there like existing user DMs?

Thanks :)

I have 100% tested this in the past, but the code has gone through so many iterations that having just tested it now it seems to sit and hang rather than redirect... Is #671 related? 🤔

@EdGeraghty EdGeraghty linked an issue Apr 22, 2022 that may be closed by this pull request
@UnixPhonez
Copy link

I'd like to add, "Note to Self" should be made by default. If an user attempts to send an message to themselves

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request ready for review ready for review or merging UI/UX View only feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"Note To Self"
4 participants