Skip to content

Conversation

@NarayanBavisetti
Copy link
Collaborator

@NarayanBavisetti NarayanBavisetti commented Dec 23, 2025

Description

This pull request updates the logic for saving page versions.

Type of Change


Note

Page versioning improvements

  • Replace page_version task with track_page_version, adding a 10‑minute coalescing window to update the latest PageVersion for the same user instead of creating duplicates
  • Ensure PagesDescriptionViewSet.partial_update captures old_description_html before save for accurate page_transaction and version comparisons
  • Persist version fields consistently (HTML, binary, JSON, stripped, sub_pages_data) and cap history at 20 entries

Written by Cursor Bugbot for commit aece921. This will update automatically on new commits. Configure here.

Summary by CodeRabbit

  • Bug Fixes

    • Page edits now correctly preserve the prior description during updates and return a clear success confirmation after partial saves.
  • New Features

    • Version history now consolidates multiple edits made within a 10-minute window to reduce duplicate entries.

✏️ Tip: You can customize this high-level summary in your review settings.

@makeplane
Copy link

makeplane bot commented Dec 23, 2025

Linked to Plane Work Item(s)

This comment was auto-generated by Plane

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 23, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

📝 Walkthrough

Walkthrough

Renames the page-version background task to track_page_version, stores the old page HTML in the view before partial updates, and enqueues a background task that either updates a recent PageVersion in-place (if same user and within timeout) or creates a new PageVersion; pruning remains (max 20 versions).

Changes

Cohort / File(s) Summary
View layer
apps/api/plane/app/views/page/base.py
Import changed from page_versiontrack_page_version. Store old_description_html before updates; construct existing_instance using the stored old HTML; call serializer.save() before side effects; enqueue background task with page_id and existing_instance and return updated success.
Background task (versioning)
apps/api/plane/bgtasks/page_version_task.py
Function renamed page_versiontrack_page_version. Added PAGE_VERSION_TASK_TIMEOUT = 600 and timezone import. If description changed, update latest PageVersion in-place when same user and within timeout (update description fields, sub_pages_data, timestamps); otherwise create a new PageVersion. Keep pruning to 20 versions and existing exception handling.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant View as PageView (partial_update)
    participant Serializer
    participant BG as track_page_version task
    participant DB as PageVersion table

    Client->>View: PATCH page (partial_update)
    View->>View: store old_description_html
    View->>Serializer: validate & serializer.save()
    Serializer-->>View: saved page instance (page_id)
    View->>BG: enqueue track_page_version(page_id, existing_instance, user_id)
    Note right of BG: background worker executes later
    BG->>DB: query latest PageVersion for page_id
    alt latest exists && same user && within timeout
        BG->>DB: update latest PageVersion in-place (description fields, sub_pages_data, updated_at)
    else
        BG->>DB: create new PageVersion record (with last_saved_at = now)
    end
    BG->>DB: prune to max 20 versions for page_id
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

🐰 I saved the old HTML before the hop,
Sent a task to track each tiny stop.
If you scribble twice within ten, I mend—
Else I birth a version and softly tend.
Thump-thump, versions pruned—onward we hop! 🥕

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: updating page version save logic, which aligns with the substantial modifications to versioning behavior in both the API view and background task.
Description check ✅ Passed The description includes a brief overview and marks the correct change type (Improvement), but lacks Test Scenarios, Screenshots, and References sections required by the template.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore-page-versioning-changes

📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8a42aff and aece921.

📒 Files selected for processing (1)
  • apps/api/plane/bgtasks/page_version_task.py
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-10-17T08:23:54.961Z
Learnt from: NarayanBavisetti
Repo: makeplane/plane PR: 7966
File: apps/api/plane/bgtasks/page_transaction_task.py:108-127
Timestamp: 2025-10-17T08:23:54.961Z
Learning: In the page transaction system (apps/api/plane/bgtasks/page_transaction_task.py), entity names (entity_name) and entity identifiers (entity_identifier) for mentions and components remain constant once set and are not hardcoded values that change, so PageLog records don't need to handle updates to existing entity attributes.

Applied to files:

  • apps/api/plane/bgtasks/page_version_task.py
📚 Learning: 2025-12-23T14:18:32.899Z
Learnt from: dheeru0198
Repo: makeplane/plane PR: 8339
File: apps/api/plane/db/models/api.py:35-35
Timestamp: 2025-12-23T14:18:32.899Z
Learning: Django REST Framework rate limit strings are flexible: only the first character of the time unit matters. Acceptable formats include: "60/s", "60/sec", "60/second" (all equivalent), "60/m", "60/min", "60/minute" (all equivalent), "60/h", "60/hr", "60/hour" (all equivalent), and "60/d", "60/day" (all equivalent). Abbreviations like "min" are valid and do not need to be changed to "minute". Apply this guidance to any Python files in the project that configure DRF throttling rules.

Applied to files:

  • apps/api/plane/bgtasks/page_version_task.py
🧬 Code graph analysis (1)
apps/api/plane/bgtasks/page_version_task.py (3)
apps/api/plane/db/models/page.py (2)
  • Page (19-73)
  • PageVersion (154-178)
apps/api/plane/utils/exception_logger.py (1)
  • log_exception (9-20)
apps/api/plane/app/views/page/base.py (2)
  • create (125-148)
  • create (472-479)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Cursor Bugbot
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (3)
apps/api/plane/bgtasks/page_version_task.py (3)

15-15: Good extraction of the magic number into a named constant.

This improves readability and maintainability by clearly documenting the 10-minute window for version consolidation.


40-54: Update logic looks correct.

The inclusion of updated_at in update_fields ensures Django's auto_now behavior works properly. The intentional omission of last_saved_at maintains fixed 10-minute intervals as designed.


73-78: Exception handling is appropriate for a background task.

Silently returning on Page.DoesNotExist is correct since the page may have been deleted between task enqueue and execution. Other exceptions are properly logged.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request updates the page version saving logic to implement version consolidation within a time window, preventing excessive version creation during rapid edits.

Key Changes:

  • Implements time-based version consolidation: updates existing versions if within 10 minutes and owned by same user, otherwise creates new versions
  • Fixes order of operations in the view to ensure proper data capture before async tasks
  • Adds sub_pages_data field tracking to page versions

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
apps/api/plane/bgtasks/page_version_task.py Implements conditional logic to update existing page versions within a 10-minute window instead of always creating new ones, and adds sub_pages_data field
apps/api/plane/app/views/page/base.py Fixes timing issue by capturing old description_html before save and moving serializer.save() before async task calls

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (2)
apps/api/plane/app/views/page/base.py (1)

556-568: Consider gating page_version call with description_html check.

The page_version task is invoked unconditionally (line 564), even when description_html is not being updated. While the task itself checks for changes (line 28 in page_version_task.py), you could avoid unnecessary task enqueueing by gating it similarly to page_transaction:

if request.data.get("description_html"):
    page_transaction.delay(...)
    page_version.delay(...)

This would prevent enqueueing the task when no description changes are made.

apps/api/plane/bgtasks/page_version_task.py (1)

33-36: Simplify ownership comparison.

The string conversion for comparing owned_by_id with user_id is unnecessary. Since these are UUID fields, they can be compared directly:

🔎 Suggested simplification
 if (
     page_version
-    and str(page_version.owned_by_id) == str(user_id)
+    and page_version.owned_by_id == user_id
     and (timezone.now() - page_version.last_saved_at).total_seconds() <= 600
 ):
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 777200d and 9eda8ba.

📒 Files selected for processing (2)
  • apps/api/plane/app/views/page/base.py
  • apps/api/plane/bgtasks/page_version_task.py
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-10-17T08:23:54.961Z
Learnt from: NarayanBavisetti
Repo: makeplane/plane PR: 7966
File: apps/api/plane/bgtasks/page_transaction_task.py:108-127
Timestamp: 2025-10-17T08:23:54.961Z
Learning: In the page transaction system (apps/api/plane/bgtasks/page_transaction_task.py), entity names (entity_name) and entity identifiers (entity_identifier) for mentions and components remain constant once set and are not hardcoded values that change, so PageLog records don't need to handle updates to existing entity attributes.

Applied to files:

  • apps/api/plane/app/views/page/base.py
📚 Learning: 2025-12-23T14:18:32.899Z
Learnt from: dheeru0198
Repo: makeplane/plane PR: 8339
File: apps/api/plane/db/models/api.py:35-35
Timestamp: 2025-12-23T14:18:32.899Z
Learning: Django REST Framework rate limit strings are flexible: only the first character of the time unit matters. Acceptable formats include: "60/s", "60/sec", "60/second" (all equivalent), "60/m", "60/min", "60/minute" (all equivalent), "60/h", "60/hr", "60/hour" (all equivalent), and "60/d", "60/day" (all equivalent). Abbreviations like "min" are valid and do not need to be changed to "minute". Apply this guidance to any Python files in the project that configure DRF throttling rules.

Applied to files:

  • apps/api/plane/app/views/page/base.py
  • apps/api/plane/bgtasks/page_version_task.py
🧬 Code graph analysis (1)
apps/api/plane/app/views/page/base.py (3)
apps/api/plane/app/serializers/page.py (1)
  • PageBinaryUpdateSerializer (169-221)
apps/api/plane/bgtasks/page_transaction_task.py (1)
  • page_transaction (81-138)
apps/api/plane/bgtasks/page_version_task.py (1)
  • page_version (17-76)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Agent
  • GitHub Check: Cursor Bugbot
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (4)
apps/api/plane/app/views/page/base.py (2)

544-548: LGTM! Correctly captures state before update.

The logic properly stores the original description_html before the serializer modifies the page instance, then uses it to construct existing_instance for the version comparison in the background task. This ensures accurate version tracking.


553-553: LGTM! Explicit save ensures proper task coordination.

Calling serializer.save() explicitly before enqueueing background tasks ensures the page is persisted to the database, allowing the tasks to fetch the updated state reliably.

apps/api/plane/bgtasks/page_version_task.py (2)

39-52: Verify last_saved_at should not be updated.

When updating an existing PageVersion, the last_saved_at field is not included in the update (lines 44-51). This means:

  • The 10-minute consolidation window is fixed from when the version was first created, not extended with each update
  • The timestamp won't reflect the actual last modification time

Example scenario:

  • Version created at 12:00 PM
  • Edit at 12:05 PM → updates same version (window: 5 min)
  • Edit at 12:15 PM → creates new version (window: 15 min > 10 min)

Is this the intended behavior? For audit/display purposes, users might expect last_saved_at to reflect the most recent save time.

Alternative: Update last_saved_at on each save

If you want last_saved_at to reflect the actual last modification time:

 page_version.description_html = page.description_html
 page_version.description_binary = page.description_binary
 page_version.description_json = page.description
 page_version.description_stripped = page.description_stripped
 page_version.sub_pages_data = sub_pages
+page_version.last_saved_at = timezone.now()
 page_version.save(
     update_fields=[
         "description_html",
         "description_binary",
         "description_json",
         "description_stripped",
         "sub_pages_data",
+        "last_saved_at",
     ]
 )

Note: This would extend the consolidation window with each save, which may or may not be desired.


54-65: LGTM! New version creation logic is correct.

The logic for creating a new PageVersion when no suitable recent version exists is well-structured. It correctly uses timezone.now() for last_saved_at and includes all necessary fields.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is being reviewed by Cursor Bugbot

Details

Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

@NarayanBavisetti NarayanBavisetti force-pushed the chore-page-versioning-changes branch from 4fa92de to 2c22e55 Compare December 24, 2025 09:24
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

♻️ Duplicate comments (1)
apps/api/plane/bgtasks/page_version_task.py (1)

24-24: Clarify the purpose of the unused sub_pages variable.

The sub_pages variable is initialized as an empty dictionary but never populated before being assigned to sub_pages_data (lines 43, 65). This issue has been flagged in multiple previous reviews.

Is this intentionally a placeholder for future functionality, or should it be removed? If it's meant to store actual sub-page data, the extraction logic is missing.

🧹 Nitpick comments (1)
apps/api/plane/bgtasks/page_version_task.py (1)

30-36: Refactor for improved code clarity and maintainability.

Several optional improvements would enhance code quality:

  1. Line 30: The variable name page_version could be more descriptive (e.g., latest_page_version) to improve readability.

  2. Line 35: String conversion of both IDs is unnecessary since they should already be comparable types. Direct comparison would be more efficient: page_version.owned_by_id == user_id

  3. Line 36: The hardcoded 600 (10-minute window) should be extracted as a module-level constant like PAGE_VERSION_CONSOLIDATION_WINDOW_SECONDS = 600 for better maintainability.

🔎 Proposed refactor

At the top of the file, add:

+# Version consolidation window in seconds (10 minutes)
+PAGE_VERSION_CONSOLIDATION_WINDOW_SECONDS = 600
+
 @shared_task
 def track_page_version(page_id, existing_instance, user_id):

Then update the logic:

-            page_version = PageVersion.objects.filter(page_id=page_id).order_by("-last_saved_at").first()
+            latest_page_version = PageVersion.objects.filter(page_id=page_id).order_by("-last_saved_at").first()

             # Get the latest page version if it exists and is owned by the user
             if (
-                page_version
-                and str(page_version.owned_by_id) == str(user_id)
-                and (timezone.now() - page_version.last_saved_at).total_seconds() <= 600
+                latest_page_version
+                and latest_page_version.owned_by_id == user_id
+                and (timezone.now() - latest_page_version.last_saved_at).total_seconds() <= PAGE_VERSION_CONSOLIDATION_WINDOW_SECONDS
             ):

-                page_version.description_html = page.description_html
+                latest_page_version.description_html = page.description_html
                 # ... (update remaining fields similarly)
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4fa92de and 8a42aff.

📒 Files selected for processing (2)
  • apps/api/plane/app/views/page/base.py
  • apps/api/plane/bgtasks/page_version_task.py
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-10-17T08:23:54.961Z
Learnt from: NarayanBavisetti
Repo: makeplane/plane PR: 7966
File: apps/api/plane/bgtasks/page_transaction_task.py:108-127
Timestamp: 2025-10-17T08:23:54.961Z
Learning: In the page transaction system (apps/api/plane/bgtasks/page_transaction_task.py), entity names (entity_name) and entity identifiers (entity_identifier) for mentions and components remain constant once set and are not hardcoded values that change, so PageLog records don't need to handle updates to existing entity attributes.

Applied to files:

  • apps/api/plane/bgtasks/page_version_task.py
  • apps/api/plane/app/views/page/base.py
📚 Learning: 2025-12-23T14:18:32.899Z
Learnt from: dheeru0198
Repo: makeplane/plane PR: 8339
File: apps/api/plane/db/models/api.py:35-35
Timestamp: 2025-12-23T14:18:32.899Z
Learning: Django REST Framework rate limit strings are flexible: only the first character of the time unit matters. Acceptable formats include: "60/s", "60/sec", "60/second" (all equivalent), "60/m", "60/min", "60/minute" (all equivalent), "60/h", "60/hr", "60/hour" (all equivalent), and "60/d", "60/day" (all equivalent). Abbreviations like "min" are valid and do not need to be changed to "minute". Apply this guidance to any Python files in the project that configure DRF throttling rules.

Applied to files:

  • apps/api/plane/bgtasks/page_version_task.py
  • apps/api/plane/app/views/page/base.py
🧬 Code graph analysis (2)
apps/api/plane/bgtasks/page_version_task.py (3)
apps/api/plane/db/models/page.py (2)
  • Page (19-73)
  • PageVersion (154-178)
apps/api/plane/utils/exception_logger.py (1)
  • log_exception (9-20)
apps/api/plane/app/views/page/base.py (2)
  • create (125-148)
  • create (472-479)
apps/api/plane/app/views/page/base.py (3)
apps/api/plane/bgtasks/page_version_task.py (1)
  • track_page_version (17-77)
apps/api/plane/app/serializers/page.py (1)
  • PageBinaryUpdateSerializer (169-221)
apps/api/plane/bgtasks/page_transaction_task.py (1)
  • page_transaction (81-138)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Analyze (javascript)
  • GitHub Check: Cursor Bugbot
🔇 Additional comments (6)
apps/api/plane/bgtasks/page_version_task.py (3)

1-17: LGTM: Clean imports and appropriate function rename.

The addition of timezone utilities and the function rename from page_version to track_page_version improves clarity and aligns with the updated versioning logic.


38-66: LGTM: Version update and creation logic is correct.

The conditional logic properly implements the intended behavior:

  • Updates existing version when owned by same user and within 10 minutes
  • Creates new version otherwise
  • Correctly includes updated_at in update_fields (line 51)
  • Intentionally does NOT update last_saved_at on updates to maintain fixed 10-minute intervals (as clarified by maintainer)

67-77: LGTM: Version pruning and error handling are appropriate.

The logic correctly maintains a cap of 20 versions per page and handles exceptions gracefully with proper logging.

apps/api/plane/app/views/page/base.py (3)

49-49: LGTM: Import updated to match renamed function.

The import correctly references the renamed track_page_version function from the background task module.


544-548: LGTM: Correct capture of old description before updates.

Storing old_description_html before calling serializer.save() ensures both the page transaction and version tracking tasks have access to the correct pre-update state. This prevents race conditions and ensures accurate change tracking.


553-568: LGTM: Proper ordering of operations and correct task invocation.

The changes demonstrate good practices:

  • serializer.save() is called before enqueuing background tasks, ensuring data consistency
  • The stored old_description_html is correctly passed to page_transaction
  • track_page_version is invoked with the correct parameters (page_id, existing_instance, user_id) matching its updated signature

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
apps/api/plane/bgtasks/page_version_task.py (1)

68-71: Potential race condition in pruning logic.

Between count() and first().delete(), another process could delete versions. If first() returns None (theoretically possible under concurrent load), calling .delete() on it raises AttributeError.

🔎 Proposed fix with null check
         # If page versions are greater than 20 delete the oldest one
         if PageVersion.objects.filter(page_id=page_id).count() > 20:
             # Delete the old page version
-            PageVersion.objects.filter(page_id=page_id).order_by("last_saved_at").first().delete()
+            oldest_version = PageVersion.objects.filter(page_id=page_id).order_by("last_saved_at").first()
+            if oldest_version:
+                oldest_version.delete()
♻️ Duplicate comments (2)
apps/api/plane/bgtasks/page_version_task.py (2)

25-25: sub_pages placeholder remains unpopulated.

This was flagged in previous reviews. The variable is initialized as an empty dictionary but never populated with actual data before being assigned to sub_pages_data.


36-36: String conversion for UUID comparison is unnecessary.

This was flagged in a previous review. Both page_version.owned_by_id and user_id should be comparable directly without string conversion, which would be more efficient and type-safe.

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8a42aff and aece921.

📒 Files selected for processing (1)
  • apps/api/plane/bgtasks/page_version_task.py
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-10-17T08:23:54.961Z
Learnt from: NarayanBavisetti
Repo: makeplane/plane PR: 7966
File: apps/api/plane/bgtasks/page_transaction_task.py:108-127
Timestamp: 2025-10-17T08:23:54.961Z
Learning: In the page transaction system (apps/api/plane/bgtasks/page_transaction_task.py), entity names (entity_name) and entity identifiers (entity_identifier) for mentions and components remain constant once set and are not hardcoded values that change, so PageLog records don't need to handle updates to existing entity attributes.

Applied to files:

  • apps/api/plane/bgtasks/page_version_task.py
📚 Learning: 2025-12-23T14:18:32.899Z
Learnt from: dheeru0198
Repo: makeplane/plane PR: 8339
File: apps/api/plane/db/models/api.py:35-35
Timestamp: 2025-12-23T14:18:32.899Z
Learning: Django REST Framework rate limit strings are flexible: only the first character of the time unit matters. Acceptable formats include: "60/s", "60/sec", "60/second" (all equivalent), "60/m", "60/min", "60/minute" (all equivalent), "60/h", "60/hr", "60/hour" (all equivalent), and "60/d", "60/day" (all equivalent). Abbreviations like "min" are valid and do not need to be changed to "minute". Apply this guidance to any Python files in the project that configure DRF throttling rules.

Applied to files:

  • apps/api/plane/bgtasks/page_version_task.py
🧬 Code graph analysis (1)
apps/api/plane/bgtasks/page_version_task.py (3)
apps/api/plane/db/models/page.py (2)
  • Page (19-73)
  • PageVersion (154-178)
apps/api/plane/utils/exception_logger.py (1)
  • log_exception (9-20)
apps/api/plane/app/views/page/base.py (2)
  • create (125-148)
  • create (472-479)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Cursor Bugbot
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (3)
apps/api/plane/bgtasks/page_version_task.py (3)

15-15: Good extraction of the magic number into a named constant.

This improves readability and maintainability by clearly documenting the 10-minute window for version consolidation.


40-54: Update logic looks correct.

The inclusion of updated_at in update_fields ensures Django's auto_now behavior works properly. The intentional omission of last_saved_at maintains fixed 10-minute intervals as designed.


73-78: Exception handling is appropriate for a background task.

Silently returning on Page.DoesNotExist is correct since the page may have been deleted between task enqueue and execution. Other exceptions are properly logged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants