diff --git a/CHANGELOG.md b/CHANGELOG.md index 8dae857aa..0a9719901 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] (beta) +### Changed +- Change file extension of messages export to json to match the content + ## [v0.15.0] (beta) - 2023-10-31 ### Added diff --git a/src/internal/m365/collection/groups/export.go b/src/internal/m365/collection/groups/export.go index f2b0b6d76..468cf1472 100644 --- a/src/internal/m365/collection/groups/export.go +++ b/src/internal/m365/collection/groups/export.go @@ -61,10 +61,12 @@ func streamItems( stats.UpdateResourceCount(path.ChannelMessagesCategory) body = data.ReaderWithStats(body, path.ChannelMessagesCategory, stats) + // messages are exported as json and should be named as such + name := item.ID() + ".json" + ch <- export.Item{ - ID: item.ID(), - // channel message items have no name - Name: item.ID(), + ID: item.ID(), + Name: name, Body: body, } } diff --git a/src/internal/m365/collection/groups/export_test.go b/src/internal/m365/collection/groups/export_test.go index 34430ba77..298154bec 100644 --- a/src/internal/m365/collection/groups/export_test.go +++ b/src/internal/m365/collection/groups/export_test.go @@ -46,7 +46,7 @@ func (suite *ExportUnitSuite) TestStreamItems() { }, }, }, - expectName: "zim", + expectName: "zim.json", expectErr: assert.NoError, }, { @@ -71,7 +71,7 @@ func (suite *ExportUnitSuite) TestStreamItems() { clues.New("I miss my cupcake."), }, }, - expectName: "gir", + expectName: "gir.json", expectErr: assert.Error, }, } diff --git a/src/internal/m365/service/groups/export_test.go b/src/internal/m365/service/groups/export_test.go index 35d4356fd..d2f1de8e2 100644 --- a/src/internal/m365/service/groups/export_test.go +++ b/src/internal/m365/service/groups/export_test.go @@ -70,7 +70,7 @@ func (suite *ExportUnitSuite) TestExportRestoreCollections_messages() { expectedItems = []export.Item{ { ID: itemID, - Name: dii.Groups.ItemName, + Name: dii.Groups.ItemName + ".json", // Body: body, not checked }, }