Compare commits
3 Commits
main
...
jules-ch-w
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e48e1518aa | ||
|
|
9374813857 | ||
|
|
aee2d61605 |
@ -258,7 +258,7 @@ func populateCollections(
|
|||||||
qp.Category,
|
qp.Category,
|
||||||
false)
|
false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, clues.Wrap(err, "making metadata path")
|
return nil, clues.Wrap(err, "making metadata path prefix")
|
||||||
}
|
}
|
||||||
|
|
||||||
col, err := graph.MakeMetadataCollection(
|
col, err := graph.MakeMetadataCollection(
|
||||||
|
|||||||
@ -133,8 +133,7 @@ func (col Collection) State() data.CollectionState {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (col Collection) DoNotMergeItems() bool {
|
func (col Collection) DoNotMergeItems() bool {
|
||||||
// TODO: depends on whether or not deltas are valid
|
return col.doNotMergeItems
|
||||||
return true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|||||||
@ -69,7 +69,15 @@ func parseMetadataCollections(
|
|||||||
|
|
||||||
switch item.ID() {
|
switch item.ID() {
|
||||||
case metadata.PreviousPathFileName:
|
case metadata.PreviousPathFileName:
|
||||||
// no-op at this time, previous paths not needed
|
if _, ok := found[category][metadata.PathKey]; ok {
|
||||||
|
return nil, false, clues.Wrap(clues.New(category.String()), "multiple versions of path metadata").WithClues(ctx)
|
||||||
|
}
|
||||||
|
|
||||||
|
for k, p := range m {
|
||||||
|
cdps.AddPath(k, p)
|
||||||
|
}
|
||||||
|
|
||||||
|
found[category][metadata.PathKey] = struct{}{}
|
||||||
|
|
||||||
case metadata.DeltaURLsFileName:
|
case metadata.DeltaURLsFileName:
|
||||||
if _, ok := found[category][metadata.DeltaKey]; ok {
|
if _, ok := found[category][metadata.DeltaKey]; ok {
|
||||||
@ -100,9 +108,16 @@ func parseMetadataCollections(
|
|||||||
}, false, nil
|
}, false, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do not remove entries that contain only a path or a delta, but not both.
|
// Remove any entries that contain a path or a delta, but not both.
|
||||||
// This condition is expected. Channels only record their path. Messages
|
// That metadata is considered incomplete, and needs to incur a
|
||||||
// only record their deltas.
|
// complete backup on the next run.
|
||||||
|
for _, dps := range cdp {
|
||||||
|
for k, dp := range dps {
|
||||||
|
if len(dp.Path) == 0 {
|
||||||
|
delete(dps, k)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return cdp, true, nil
|
return cdp, true, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@ -365,7 +365,11 @@ func (op *BackupOperation) do(
|
|||||||
return nil, clues.Wrap(err, "producing manifests and metadata")
|
return nil, clues.Wrap(err, "producing manifests and metadata")
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx = clues.Add(ctx, "can_use_metadata", canUseMetadata)
|
ctx = clues.Add(
|
||||||
|
ctx,
|
||||||
|
"can_use_metadata", canUseMetadata,
|
||||||
|
"assist_bases", len(mans.AssistBases()),
|
||||||
|
"merge_bases", len(mans.MergeBases()))
|
||||||
|
|
||||||
if canUseMetadata {
|
if canUseMetadata {
|
||||||
lastBackupVersion = mans.MinBackupVersion()
|
lastBackupVersion = mans.MinBackupVersion()
|
||||||
@ -711,6 +715,7 @@ func mergeDetails(
|
|||||||
|
|
||||||
// Don't bother loading any of the base details if there's nothing we need to merge.
|
// Don't bother loading any of the base details if there's nothing we need to merge.
|
||||||
if bases == nil || dataFromBackup == nil || dataFromBackup.ItemsToMerge() == 0 {
|
if bases == nil || dataFromBackup == nil || dataFromBackup.ItemsToMerge() == 0 {
|
||||||
|
logger.Ctx(ctx).Info("no base details to merge")
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -129,7 +129,7 @@ func (c Channels) GetChannelMessageIDsDelta(
|
|||||||
}
|
}
|
||||||
|
|
||||||
for _, v := range vals {
|
for _, v := range vals {
|
||||||
if v.GetAdditionalData()[graph.AddtlDataRemoved] == nil {
|
if v.GetDeletedDateTime() == nil {
|
||||||
added[ptr.Val(v.GetId())] = struct{}{}
|
added[ptr.Val(v.GetId())] = struct{}{}
|
||||||
} else {
|
} else {
|
||||||
deleted[ptr.Val(v.GetId())] = struct{}{}
|
deleted[ptr.Val(v.GetId())] = struct{}{}
|
||||||
|
|||||||
@ -57,6 +57,20 @@ func Sites(ctx context.Context, acct account.Account, errs *fault.Bus) ([]*Site,
|
|||||||
return getAllSites(ctx, ac.Sites())
|
return getAllSites(ctx, ac.Sites())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func GetSite(ctx context.Context, acct account.Account, siteID string, errs *fault.Bus) (*Site, error) {
|
||||||
|
ac, err := makeAC(ctx, acct, path.SharePointService)
|
||||||
|
if err != nil {
|
||||||
|
return nil, clues.Stack(err).WithClues(ctx)
|
||||||
|
}
|
||||||
|
|
||||||
|
site, err := ac.Sites().GetByID(ctx, siteID)
|
||||||
|
if err != nil {
|
||||||
|
return nil, clues.Wrap(err, "retrieving site")
|
||||||
|
}
|
||||||
|
|
||||||
|
return ParseSite(site), nil
|
||||||
|
}
|
||||||
|
|
||||||
func getAllSites(
|
func getAllSites(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
ga getAller[models.Siteable],
|
ga getAller[models.Siteable],
|
||||||
|
|||||||
@ -25,3 +25,5 @@ Below is a list of known Corso issues and limitations:
|
|||||||
not be inheritable by children.
|
not be inheritable by children.
|
||||||
|
|
||||||
* Link shares with password protection can't be restored.
|
* Link shares with password protection can't be restored.
|
||||||
|
|
||||||
|
* All replies in a Teams Conversation are removed from backup when the root message gets deleted.
|
||||||
Loading…
x
Reference in New Issue
Block a user