feat(storage): add native PostgreSQL runtime and verified offline application import
Build and publish container images / images (push) Failing after 12m29s
Build and publish container images / images (push) Failing after 12m29s
This commit is contained in:
1 parent
96065d1e89
commit
0ba1dcfef0
243 files changed
+21441
-3090
No files matched your search
@@ -89,6 +89,7 @@ func (s *Server) handleSaveRevisionAPI(
|
||||
return
|
||||
}
|
||||
domainUUID := s.domainUUIDForRequest(r)
|
||||
actorUUID := ""
|
||||
if req.EditorPrincipal != nil {
|
||||
principal, e := s.store.PrincipalForSession(domainUUID, s.authTokenFromRequest(r))
|
||||
id := ""
|
||||
@@ -106,10 +107,14 @@ func (s *Server) handleSaveRevisionAPI(
|
||||
api.WriteError(w, http.StatusUnauthorized, "authentication_required", "authentication required")
|
||||
return
|
||||
}
|
||||
var revisionCount int
|
||||
_ = s.store.DB.QueryRow(`SELECT COUNT(*) FROM revisions WHERE object_uuid=?`, req.ObjectUUID).Scan(&revisionCount)
|
||||
actorUUID = principal.UUID
|
||||
hasRevision, revisionErr := s.store.ObjectHasRevision(r.Context(), req.ObjectUUID)
|
||||
if revisionErr != nil {
|
||||
api.WriteError(w, 500, "storage_unavailable", "revision state unavailable")
|
||||
return
|
||||
}
|
||||
capability := "write"
|
||||
if revisionCount == 0 {
|
||||
if !hasRevision {
|
||||
capability = "create"
|
||||
}
|
||||
allowed := false
|
||||
@@ -129,12 +134,7 @@ func (s *Server) handleSaveRevisionAPI(
|
||||
}
|
||||
}
|
||||
|
||||
var revision *store.Revision
|
||||
if req.BaseRevision != nil {
|
||||
revision, err = s.store.SaveRevisionContentIfHead(req.ObjectUUID, []byte(req.Body), req.Message, req.Language, req.ContentType, req.Filename, *req.BaseRevision)
|
||||
} else {
|
||||
revision, err = s.store.SaveRevisionContent(req.ObjectUUID, []byte(req.Body), req.Message, req.Language, req.ContentType, req.Filename)
|
||||
}
|
||||
revision, err := s.store.SaveRevisionContentInDomain(r.Context(), domainUUID, actorUUID, req.ObjectUUID, []byte(req.Body), req.Message, req.Language, req.ContentType, req.Filename, req.BaseRevision)
|
||||
if errors.Is(err, store.ErrRevisionConflict) {
|
||||
api.WriteError(w, http.StatusConflict, "revision_conflict", "document changed; reload the language head before saving")
|
||||
return
|
||||
|
||||
Reference in new issue
Block a user