Commit graph

89 commits

Author SHA1 Message Date
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
Andrey Antukh
1794ea0d9e Merge remote-tracking branch 'origin/staging' into develop 2023-08-29 13:25:51 +02:00
Andrey Antukh
ddbc828342 🐛 Fix unexpected output on get-page when invalid object-id is provided 2023-08-29 13:04:23 +02:00
Andrey Antukh
496afb0f25 Merge remote-tracking branch 'origin/staging' into develop 2023-08-24 12:02:40 +02:00
Alejandro Alonso
834c18323e Revert "📎 Update version.txt file"
This reverts commit a7f39e89f6.
2023-08-23 09:38:07 +02:00
Andrey Antukh
e6664013ba Merge remote-tracking branch 'origin/staging' into develop 2023-08-21 17:26:21 +02:00
Alejandro Alonso
a7f39e89f6 📎 Update version.txt file 2023-08-18 10:35:12 +02:00
Andrey Antukh
6c13925930 🐛 Fix bad interaction of file migrations components-v2 and pointer-map feature 2023-07-13 15:00:28 +02:00
Andrey Antukh
875a3cf63c 🐛 Fix bad interaction of file migrations components-v2 and pointer-map feature 2023-07-13 12:19:22 +02:00
Andrey Antukh
dae5e71fa1 Mark new or updated files with new features
for avoid crossversion modifications
2023-07-11 17:27:36 +02:00
Andrey Antukh
dfc2ab56a9 💄 Fix code style consistency on schema declarations on file ns 2023-07-11 17:27:36 +02:00
Andrey Antukh
405aa66357 🎉 Add new shape & rect data structures
Also optimizes some functions for faster shape and rect props
access (there is still a lot of work ahead optimizing the rest of
the functions)

Also normalizes shape creation and validation for ensuring
correct setup of all the mandatory properties.
2023-07-11 17:27:35 +02:00
Andrey Antukh
09d28d8583 Add better file feature handling on file retrieval 2023-07-10 12:44:07 +02:00
Alejandro Alonso
009236bbe3 🐛 Fix export from shared prototype 2023-07-05 13:22:50 +02:00
Andrey Antukh
17731db28b 🐛 Fix file etag calculation considering the profile id too 2023-06-27 13:55:55 +02:00
Andrey Antukh
840801ea15 🐛 Don't update modified_at field on applying components migration 2023-06-23 16:28:52 +02:00
Andrey Antukh
2a81d8563a 🐛 Fix thumbnails handling on dashboard libraries 2023-06-23 12:24:49 +02:00
Andrey Antukh
d11b007795 Add thumbnail renderer
And integrate the dashboard thumbnails to use that service
2023-06-21 20:10:49 +02:00
Andrey Antukh
d016876710 🐛 Add missing file-id validation on get-page rpc method 2023-06-19 13:07:26 +02:00
Andrey Antukh
ddeb540df6 🐛 Fix pointer map related issues on get-page rpc method
mainly used on render.html endpoint which is used by exporter
2023-06-19 13:06:44 +02:00
Andrés Moya
6edba71c12 🐛 Fix calculation of component modified and remove unneeded check 2023-06-16 13:24:41 +02:00
Andrey Antukh
b87f0bd5e8 🐛 Fix issue on features handling function 2023-06-01 06:28:00 +02:00
Alejandro Alonso
c189b5e638 🐛 Disable old urls when moving files between projects 2023-05-29 11:56:42 +02:00
Andrey Antukh
8f72faf27d 🐛 Fix issues on penpot file import and components-v2 2023-05-26 08:04:01 +02:00
Andrey Antukh
a455fc015b 🐛 Fix several issues related to pointer-map and components-v2 2023-05-26 07:57:28 +02:00