Messages in builder

Holy messages batman!

I think it would be good to get a wiki page up for what some fields in messages are and what their intended purpose is. For example: requestor_id or owner_id. Another issue I find myself bumping into is when to use origin vs origin_id in a message. If you have any domain knowledge about some of these standard message fields drop a note in here and I’ll curate it into a wiki post.

@salam @raskchanky

1 Like

Historically, the distinction between origin vs origin_id has mostly been whatever’s the most convenient for the message you’re writing. Both of them function identically as a route key (resolve to the same shard). I don’t think we’ve had any hard and fast rules around when to use which. It’s just been left up to the discretion of the person writing the code.

Both requestor_id and owner_id have typically referred to the account_id of the logged in user that performed the action, with the distinction being that owner_id is used when someone can own something, like an origin or a package. If there’s no ownership involved, then requestor_id is used, but again, this distinction is somewhat arbitrary and just left up to people’s discretion.

On the whole, we should be a lot more disciplined around the naming of fields in the messages and at least attempt to follow some conventions.

Yp, one more naming thing that is somewhat confusing is session_id vs account_id - they are also both the same thing, at least de-facto.