Skip to content

Tmp/editable aliases#271

Open
HocusLocusTee wants to merge 2 commits intostagingfrom
tmp/editable-aliases
Open

Tmp/editable aliases#271
HocusLocusTee wants to merge 2 commits intostagingfrom
tmp/editable-aliases

Conversation

@HocusLocusTee
Copy link
Copy Markdown
Collaborator

@HocusLocusTee HocusLocusTee commented Oct 20, 2025

what?

adds the ability for a user to edit their aliases from the contact info modal
extracts self stash to a hook

fixes a bug (that was reintroduced) where the client processes messages when logged in then logged out again

some thoughts while working on this:
nearly everyone could use the same alias and just rely on the client to successfully or not successfully decrypt, encrypt the message - the impact of this requires some fundamental protocol thought from me.

additionally this also gives the ability for on-chain handshake obfuscation. where party A and party B could start a regular chat sending a transaction handshake to each other.
then within the encrypted chat they could agree on new aliases and swap those. a third party could assume that this has taken place but its not provable.

@HocusLocusTee HocusLocusTee marked this pull request as ready for review October 25, 2025 00:33
@IzioDev
Copy link
Copy Markdown
Contributor

IzioDev commented Oct 25, 2025

nearly everyone could use the same alias and just rely on the client to successfully or not successfully decrypt, encrypt the message - the impact of this requires some fundamental protocol thought from me.

Kasia in its early days was kind of working like this: process every messages and try to decrypt, whether or not the alias was known. This added extra slowness randomly while using the application (background listening + decrypt)

this.processBlockAdded.bind(this)
);
async stop() {
this.rpc.removeEventListener("block-added", this.boundProcessBlockAdded);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Are we implying this line isn't working as intended?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Are you talking about this line or
in general? Observed behaviour before this is we still process blocks when logged out (after logging in). Unsubbing for block added is the main fix

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yes this line,
So based on your comment it seems like this.rpc.removeEventListener("block-added", this.boundProcessBlockAdded); isn't working, but still your added line makes sense.

It's just that the previous one should stop incoming block for being processed, while the other one should tell block processor to stop ingest them (but they still are incoming)

I'll have a look 👍

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could you please annotate the line (await this.rpc.unsubscribeBlockAdded();) with a TODO, like: This shouldn't be necessary as the listener on block-added is supposed to be removed (which seems to not be the case), so we force the un subscription from internal system

Comment thread src/store/messaging.store.ts Outdated
Comment on lines +601 to +610
// update the conversation reference with the latest from manager
// this ensures alias updates from self-stash are reflected (newer than db aliases)
oooc.conversation = conversationWithContact.conversation;
oooc.contact = conversationWithContact.contact;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

todo izio: validate this flow and see if we shouldn't handle it elsewhere

note: it is expected (not necessarily working in every case) that this whole logic takes the last knows alias based on date of events, if there are multiple receive / sent for a single recipient, we should take the last known one, regardless

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Note: without this we would save the new alias. Stash it. Log out and back in but contact info model would reference old alias. So
You could either edit it which would update the state or just log out and back in again.
Initial self stash is handles already in logic above this line.

Copy link
Copy Markdown
Contributor

@IzioDev IzioDev Oct 25, 2025

Choose a reason for hiding this comment

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

Stash it. Log out and back in but contact info model would reference old alias

This likely indicate a greater issue where newer handshake (received / sent) events on this conversation aren't being ingested properly, potentially the same happens if I receive a new handshake while already having a conversation, we'd like the new handshake to be the new source of truth

@IzioDev
Copy link
Copy Markdown
Contributor

IzioDev commented Dec 12, 2025

After this comment #271 (comment), mergeable 🚀

@HocusLocusTee
Copy link
Copy Markdown
Collaborator Author

After this comment #271 (comment), mergeable 🚀

I still not quite understand. Irrespective of the 'bug' of us receiving blocks after removing event listener - why would we not want to unsub?

Note: I had to re-base on staging.

@IzioDev
Copy link
Copy Markdown
Contributor

IzioDev commented Jan 9, 2026

After this comment #271 (comment), mergeable 🚀

I still not quite understand. Irrespective of the 'bug' of us receiving blocks after removing event listener - why would we not want to unsub?

Note: I had to re-base on staging.

We do want to unsub, it's the correct line to add. But it's also has reflected an underlying bug

ui: show aliases from contact info modal
feat: add tooltip component and use in alias info
WIP: adjust alias
feat: more work

- refactor alias update
- add ability to get convo by id
- extract alias validator

style: improve alias editing
style: warn block and misc styling
refactor: extract send self stash to a hook
fix: update convo reference on load

- make sure we are removign the right event listener
- unsub from block added sub

chore:rebase
@IzioDev IzioDev force-pushed the tmp/editable-aliases branch from 2f7572f to bf60444 Compare January 31, 2026 17:59
@IzioDev
Copy link
Copy Markdown
Contributor

IzioDev commented Jan 31, 2026

Modified so we allow editing their alias even if N/A (unset)

If you're satisfied with the change, LGTM @HocusLocusTee

@HocusLocusTee
Copy link
Copy Markdown
Collaborator Author

Modified so we allow editing their alias even if N/A (unset)

If you're satisfied with the change, LGTM @HocusLocusTee

I was planning to not merge this. And just pick some relevant parts after deterministic alias is added.

@IzioDev
Copy link
Copy Markdown
Contributor

IzioDev commented Jan 31, 2026

All right, good for me! Should we mark it draft?

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.

2 participants