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
@@ -16,15 +16,15 @@ func TaskRecreationID(request string) string {
|
||||
return uuid.NewSHA1(uuid.NameSpaceURL, []byte("pages:task-recreate:"+request)).String()
|
||||
}
|
||||
|
||||
func deletedCapture(ctx context.Context, q interface {
|
||||
func (s *Store) deletedCapture(ctx context.Context, q interface {
|
||||
QueryRowContext(context.Context, string, ...any) *sql.Row
|
||||
}, domain, actor, request string) error {
|
||||
var id string
|
||||
if err := q.QueryRowContext(ctx, `SELECT item_uuid FROM organizer_capture_receipts WHERE domain_uuid=? AND owner_uuid=? AND request_uuid=?`, domain, actor, request).Scan(&id); err != nil {
|
||||
if err := q.QueryRowContext(ctx, `SELECT item_uuid FROM organizer_capture_receipts WHERE domain_uuid=`+s.sqlParam(1)+` AND owner_uuid=`+s.sqlParam(2)+` AND request_uuid=`+s.sqlParam(3), domain, actor, request).Scan(&id); err != nil {
|
||||
return err
|
||||
}
|
||||
var live, deleted bool
|
||||
if err := q.QueryRowContext(ctx, `SELECT EXISTS(SELECT 1 FROM organizer_items WHERE domain_uuid=? AND uuid=?), EXISTS(SELECT 1 FROM organizer_task_deletions WHERE domain_uuid=? AND owner_uuid=? AND item_uuid=?)`, domain, id, domain, actor, id).Scan(&live, &deleted); err != nil {
|
||||
if err := q.QueryRowContext(ctx, `SELECT EXISTS(SELECT 1 FROM organizer_items WHERE domain_uuid=`+s.sqlParam(1)+` AND uuid=`+s.sqlParam(2)+`), EXISTS(SELECT 1 FROM organizer_task_deletions WHERE domain_uuid=`+s.sqlParam(3)+` AND owner_uuid=`+s.sqlParam(4)+` AND item_uuid=`+s.sqlParam(5)+`)`, domain, id, domain, actor, id).Scan(&live, &deleted); err != nil {
|
||||
return err
|
||||
}
|
||||
if live {
|
||||
@@ -39,15 +39,16 @@ func deletedCapture(ctx context.Context, q interface {
|
||||
// RecreateCapturedTask never removes old receipts, tombstones or DAV identity
|
||||
// reservations. A deterministic successor ID makes a lost response retry safe.
|
||||
// The caller authorizes read/create/write for target, including retained pages.
|
||||
func (s *Store) RecreateCapturedTask(ctx context.Context, domain, actor, request, hash string, item TaskRecord, target, body, replaces string) (TaskRecord, error) {
|
||||
func (s *Store) RecreateCapturedTask(ctx context.Context, domain, actor, request, hash string, item TaskRecord, target, body, replaces string) (result TaskRecord, resultErr error) {
|
||||
defer func() { resultErr = s.sqlError("task recreation", resultErr) }()
|
||||
id, err := uuid.Parse(replaces)
|
||||
if err != nil || id.String() != replaces || request != TaskRecreationID(replaces) {
|
||||
return TaskRecord{}, ErrTaskInvalid
|
||||
}
|
||||
if err = taskActor(ctx, s.DB, domain, actor, true); err != nil {
|
||||
if err = s.taskActor(ctx, s.DB, domain, actor, true); err != nil {
|
||||
return TaskRecord{}, err
|
||||
}
|
||||
if err = deletedCapture(ctx, s.DB, domain, actor, replaces); err != nil {
|
||||
if err = s.deletedCapture(ctx, s.DB, domain, actor, replaces); err != nil {
|
||||
return TaskRecord{}, err
|
||||
}
|
||||
return s.captureTaskWithWiki(ctx, domain, actor, request, hash, item, target, body, replaces)
|
||||
|
||||
Reference in new issue
Block a user