Skip to content

Commit

Permalink
refactor: revert changes to didcomm message record
Browse files Browse the repository at this point in the history
Will be addressed in a separate PR

Signed-off-by: Timo Glastra <[email protected]>
  • Loading branch information
TimoGlastra committed Apr 20, 2022
1 parent f4e974b commit df9d3d7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ describe('DidCommMessageRecord', () => {
threadId: 'ea24e14a-4fc4-40f4-85a0-f6fcf02bfc1c',
protocolName: 'test-protocol',
messageName: 'send-test',
versionMajor: '1',
versionMinor: '0',
messageType: 'https://didcomm.org/test-protocol/1.0/send-test',
messageId: '7eb74118-7f91-4ba9-9960-c709b036aa86',
})
Expand Down
8 changes: 7 additions & 1 deletion packages/core/src/storage/didcomm/DidCommMessageRecord.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ export type DefaultDidCommMessageTags = {
// Computed
protocolName: string
messageName: string
versionMajor: string
versionMinor: string
messageType: string
messageId: string
threadId: string
Expand Down Expand Up @@ -59,7 +61,9 @@ export class DidCommMessageRecord extends BaseRecord<DefaultDidCommMessageTags>
public getTags() {
const messageId = this.message['@id'] as string
const messageType = this.message['@type'] as string
const { protocolName, messageName } = parseMessageType(messageType)

const { protocolName, protocolVersion, messageName } = parseMessageType(messageType)
const [versionMajor, versionMinor] = protocolVersion.split('.')

const thread = this.message['~thread']
let threadId = messageId
Expand All @@ -77,6 +81,8 @@ export class DidCommMessageRecord extends BaseRecord<DefaultDidCommMessageTags>
threadId,
protocolName,
messageName,
versionMajor,
versionMinor,
messageType,
messageId,
}
Expand Down

0 comments on commit df9d3d7

Please sign in to comment.