validateSyncDataForImport validates for a non-empty sync data that the sync data is valid for import. If s=ofund to not be valid will return HTTP error 422 (Unprocessable Entity) and increment the import error count.
(ctx context.Context, db *DatabaseContext, docID string)
| 625 | // validateSyncDataForImport validates for a non-empty sync data that the sync data is valid for import. If s=ofund to |
| 626 | // not be valid will return HTTP error 422 (Unprocessable Entity) and increment the import error count. |
| 627 | func (s *SyncData) validateSyncDataForImport(ctx context.Context, db *DatabaseContext, docID string) error { |
| 628 | if !s.SyncIsEmpty() && !s.HasValidSyncData() { |
| 629 | base.WarnfCtx(ctx, "Invalid sync data for doc %s - not importing.", base.UD(docID)) |
| 630 | db.DbStats.SharedBucketImportStats.ImportErrorCount.Add(1) |
| 631 | return base.HTTPErrorf(http.StatusNotFound, "Not imported, invalid sync data found") |
| 632 | } |
| 633 | return nil |
| 634 | } |
| 635 | |
| 636 | func (s *SyncData) SyncIsEmpty() bool { |
| 637 | if s == nil { |
no test coverage detected