Commit Graph

113 Commits

Author SHA1 Message Date
Andrey Antukh
790f6ce4ed 💄 Add cosmetic changes to get-file rpc method 2024-10-16 17:58:04 +02:00
Andrey Antukh
40d7bb04b4 Reuse permission from rpc/cond middleware for get-file rpc method 2024-10-16 17:58:04 +02:00
Pablo Alba
22d7cfc7fa 🐛 Fix missing permissions on file cache 2024-10-16 17:58:04 +02:00
Alejandro Alonso
a1fc785771 Merge remote-tracking branch 'origin/staging' into superalex-merge-conflicts-2 2024-09-23 10:08:06 +02:00
Andrey Antukh
b882b9e283 🔥 Remove usage of public usage of sm/define funcion 2024-09-13 11:30:55 +02:00
Andrey Antukh
d03788af93 🐛 Ignore object thumbnail requests if file is already marked as deleted 2024-09-12 15:23:31 +02:00
Alejandro Alonso
017aad6454 🐛 Fix export failed error when exporting multiple shapes 2024-09-12 12:55:32 +02:00
alonso.torres
03040ed40b 🐛 Fix problem when dismissing shared library update 2024-09-06 11:02:02 +02:00
Andrey Antukh
ceaafdbb1c Add offload mechanism for file snapshots 2024-08-26 13:52:42 +02:00
Andrey Antukh
cacee40d11 🎉 Add proper schema encoding/decoding mechanism
this allows almost all api operations to success usin application/json
encoding with the exception of the update-file, which we need to
approach a bit differently;

the reason update-file is different, is because the operations vector
is right now defined without the context of shape type, so we are just
unable to properly parse the value to correct type using the schema
decoding mechanism
2024-08-21 11:27:36 +02:00
Pablo Alba
6169f5c2e8 🎉 New oops page with login and request access 2024-08-14 15:32:04 +02:00
Andrey Antukh
0e92bcc0de 🎉 Add file-data offload mechanism 2024-08-09 14:28:18 +02:00
Andrey Antukh
86a732600b Add naming consistency changes for file_data_fragment table 2024-08-07 16:34:39 +02:00
Andrey Antukh
3eaa997145 Merge remote-tracking branch 'origin/staging' into develop 2024-07-26 08:36:30 +02:00
Andrey Antukh
defcef3e59 Resolve file thumbnail on frontend instead of backend 2024-07-25 15:17:41 +02:00
Andrey Antukh
28c2197ba7 ♻️ Add string length validation to backend RPC methods fields 2024-07-04 12:30:28 +02:00
Andrey Antukh
e9a28b034f 🔥 Replace spec with schema on file RPC methods 2024-07-04 12:30:28 +02:00
Andrey Antukh
ec4260830c ♻️ Add API consistency fixes for task calling
Also adds a helper for calling tasks synchronously
2024-06-25 13:24:17 +02:00
Andrey Antukh
574c8d1789 Move library-absorb operation to async task
And make it not mandatory in case of failure
2024-05-27 11:19:15 +02:00
Andrey Antukh
761bbb7334 Add srepl helpers for delete/restore teams, projects, and files 2024-05-27 11:17:00 +02:00
Andrey Antukh
584a0fdba1 Reduce locking on objects-gc task
The main issue was the long running gc operation that
affects storage objects with deduplication. The long running
transacion ends locking some storage object rows which collaterally
made operations like import-binfile become blocked indefinitelly
because of the same rows (because of deduplication).

The solution used in this commit is split operations on small
chunks so we no longer use long running transactions that holds
too many locks. With this approach we will make a window to work
concurrently all operarate the distinct operations that requires
locks on the same rows.
2024-05-23 16:35:54 +02:00
Alejandro Alonso
22fd0ae306 🐛 Update modification date on publish/unpublish file as library 2024-03-25 14:17:07 +01:00
Aitor Moreno
69ab02fc45 Merge pull request #4159 from penpot/alotor-bugfix-viewer
Alotor bugfix viewer
2024-02-19 17:46:50 +01:00
alonso.torres
619b557c80 🐛 Fix anonymous access to shared prototypes 2024-02-19 09:39:12 +01:00
Andrey Antukh
b718a282e0 ♻️ Add minor refactor to file migrations
Relevant changes:

- Add the ability to create migration in both directions, defaulting
  to identity if not provided
- Move the version attribute to file table column for to make it more
  accessible (previously it was on data blob)
- Reduce db update operations on file-update rpc method
2024-02-19 09:20:47 +01:00
Andrey Antukh
6d35cb2eb4 Improve snapshot related internal API
This commit also adds the ability to take snapshot of all files
of the team in a single run/transaction.
2024-02-09 12:01:09 +01:00
Andrey Antukh
6ad6e6f856 🐛 Fix objects-map and pointer-map issues on file crud 2024-01-25 16:03:29 +01:00
Aitor Moreno
03931da17a Merge pull request #3989 from penpot/niwinz-staging-bugfix-1
🐛 Bugfixes
2024-01-15 16:03:23 +01:00
Andrés Moya
b7b7b9d580 🐛 Touch modified file when ignore sync, to avoid ETAG caching 2024-01-09 18:28:32 +01:00
Andrey Antukh
8919a7067e 🐛 Fix incorrect thumbnail queries on file related rpc methods 2024-01-09 15:00:23 +01:00
Andrey Antukh
746d898245 Improve the db api efficiency
Mainly setup proper defaults and reduce unnecesary allocations
on every db api call.
2024-01-04 12:41:16 +01:00
Andrey Antukh
addb392ecc Add safety mechanism for direct object deletion
The main objective is prevent deletion of objects that can leave
unreachable orphan objects which we are unable to correctly track.

Additionally, this commit includes:

1. Properly implement safe cascade deletion of all participating
   tables on soft deletion in the objects-gc task;

2. Make the file thumbnail related tables also participate in the
   touch/refcount mechanism applyign to the same safety checks;

3. Add helper for db query lazy iteration using PostgreSQL support
   for server side cursors;

4. Fix efficiency issues on gc related task using server side
   cursors instead of custom chunked iteration for processing data.

   The problem resided when a large chunk of rows that has identical
   value on the deleted_at column and the chunk size is small (the
   default); when the custom chunked iteration only reads a first N
   items and skip the rest of the set to the next run.

   This has caused many objects to remain pending to be eliminated,
   taking up space for longer than expected. The server side cursor
   based iteration does not has this problem and iterates correctly
   over all objects.

5. Fix refcount issues on font variant deletion RPC methods
2024-01-03 10:56:57 +01:00
Andrey Antukh
ac20451ae7 Simplify feature handling on get-file 2023-12-15 15:18:04 +01:00
Andrey Antukh
78260fbc42 🐛 Fix no migration are applied on accessing to a file 2023-12-15 15:18:04 +01:00
Andrey Antukh
611594a392 Add general features handling improvements 2023-12-14 10:35:24 +01:00
Andrey Antukh
08b9178a65 🐛 Fix incorrect behavior on set-file-shared rpc method 2023-12-14 10:35:24 +01:00
Andrey Antukh
d5e3cba92c 🐛 Fix issue on set-file-shared 2023-12-13 14:20:07 +01:00
Andrey Antukh
417366d998 Reorganize fdata/pointer-map feature helpers
Mainly move all pointer-map related helpers from app.rpc.commands.files
to the the app.features.fdata namespace and normalizes codestile around
feature handling on all affected code.

This commit also comes with several features related bugifxes on the
components-v2 migration code:

- properly migrate legacy feature names on apply components-v2 migration
- start using new fdata feature related functions
- prevent generation of a ephimeral pointer on each graphic migration
  operation; on large files this caused a very noticiable overhead of
  creating a big number of completly unused pointer maps
- do persistence after validation and not before
2023-12-13 14:20:07 +01:00
Andrey Antukh
76a6f077a6 🐛 Fix incorrect feature handling on absorb-library! fn
Used in shared flag assignation and library deletion
2023-12-13 11:56:20 +01:00
Andrey Antukh
afa735a9c1 Add protection for version inconsistency on opening or editing file 2023-12-11 17:14:20 +01:00
Andrey Antukh
ad0378270f Add missing sm/define on some file and file-thumbnails rpc methods 2023-12-11 17:14:20 +01:00
Andrey Antukh
f1d8abf160 Migrate file feature names when fdata migrations are applied 2023-12-11 17:14:20 +01:00
Andrey Antukh
87615ce221 💄 Fix format issues on backend module 2023-11-29 12:55:58 +01:00
Andrey Antukh
52fbc678f3 ♻️ Move app.common.pages to app.common.files 2023-11-16 11:07:36 +01:00
Andrey Antukh
f1782f746d Add better error reporting on load-pointer function 2023-11-15 14:01:34 +01:00
Andrey Antukh
26d3d7f1a8 🐛 Fix features related issues with render entrypoint (exporter) 2023-11-14 10:55:55 +01:00
Andrey Antukh
6f93b41920 🎉 Add features assignation for teams 2023-11-07 12:48:31 +01:00
Andrés Moya
2fe820304e Add some migrations and fixes to component-v2 migration 2023-10-20 16:13:01 +02:00
Pablo Alba
d615fbb282 🎉 Warn about empty libraries on the share library dialog 2023-09-19 09:52:40 +02:00
Andrey Antukh
ef4bd8c598 🐛 Fix incorrect interaction of library-absorb mechanism and storage-pointes 2023-09-14 17:45:56 +02:00