Skip to content

Commit

Permalink
feat(daemon): include formula identifiers in package messages
Browse files Browse the repository at this point in the history
  • Loading branch information
kumavis committed Jan 25, 2024
1 parent 745eeb2 commit aa1e7fd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
12 changes: 10 additions & 2 deletions packages/daemon/src/mail.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,11 @@ export const makeMailboxMaker = ({
const dubMessage = message => {
const { type } = message;
if (type === 'request') {
const { who: senderFormulaIdentifier, dest: recipientFormulaIdentifier, ...rest } = message;
const {
who: senderFormulaIdentifier,
dest: recipientFormulaIdentifier,
...rest
} = message;
const [senderName] = reverseLookupFormulaIdentifier(
senderFormulaIdentifier,
);
Expand All @@ -112,7 +116,11 @@ export const makeMailboxMaker = ({
}
return undefined;
} else if (type === 'package') {
const { formulas: _, who: senderFormulaIdentifier, dest: recipientFormulaIdentifier, ...rest } = message;
const {
who: senderFormulaIdentifier,
dest: recipientFormulaIdentifier,
...rest
} = message;
const [senderName] = reverseLookupFormulaIdentifier(
senderFormulaIdentifier,
);
Expand Down
3 changes: 1 addition & 2 deletions packages/daemon/src/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,9 @@ export type Package = {
type: 'package';
strings: Array<string>; // text that appears before, between, and after named formulas.
names: Array<string>; // edge names
};
export type InternalPackage = Package & {
formulas: Array<string>; // formula identifiers
};
export type InternalPackage = Package;

export type Payload = Request | Package;
export type InternalPayload = InternalRequest | InternalPackage;
Expand Down

0 comments on commit aa1e7fd

Please sign in to comment.