[Bug] Publishing and duplicating database record pages fails when they contain linked database views

Open
#9,117 2 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
dart
Domain
databases

Research direction

Start with the reported backend entry points: libs/appflowy-cloud-publishing/src/api/workspace/publish.rs, libs/appflowy-cloud-publishing/src/biz/workspace/publish_asset_rewriter.rs, and libs/appflowy-cloud-pages/src/pages.rs near line 1237. Reproduce by publishing and duplicating a database record page with a linked database grid, then compare with a page containing a regular inline grid. Done means both actions succeed while preserving the linked view behavior.

Written by the indexing model from the issue text.

Description

Bug Description

Publishing or duplicating an individual database record page fails when the page contains an inline linked database grid view referencing an existing database elsewhere in the workspace.

The problem is specific to linked database views. Normal inline grids created directly within the page work correctly.

The issue is reproducible with newly created database records and is not limited to older or migrated records.

How to Reproduce
  1. Create a database named Company.

  2. Create a second database named Opportunities.

  3. Add records to both databases.

  4. Open an individual record within Company as a full page.

  5. Insert a linked database grid view referencing the existing Opportunities database.

  6. Attempt to publish the individual Company record page from AppFlowy Desktop.

  7. Observe Error 1017.

  8. Attempt to duplicate the same Company record page.

  9. Observe the invalid-request error.

  10. Remove the linked database grid view from the Company record

  11. Attempt publishing again.

Result: Publishing succeeds after the linked database view is removed.

The problem also occurs with newly created records, making legacy record corruption an unlikely explanation.

Expected Behavior

Expected Behavior

An individual database record page containing a linked view of another database should:

Publish successfully and generate a publicly accessible page.

Preserve or correctly render the linked database view in the published page, subject to supported publishing behavior.

Allow the parent record page to be duplicated without returning an invalid-request error.

Actual Behavior

When attempting to publish a database record page containing a linked database grid:

Publishing error:

We couldn't publish this page.

Error 1017: We couldn't confirm whether this action finished. Check the result before trying again.

Operating System

Windows 11

AppFlowy Version(s)

0.15.0

Screenshots

No response

Additional Context

Database Relationships

The actual environment contains:

  • A Company database.

  • An Opportunities database.

  • Individual Company records containing embedded linked views of Opportunities.

  • Opportunities records that may contain relationships to entries in other databases.

It has not been determined whether additional database relationships contribute to the issue.

The consistent failure condition is the presence of an embedded linked database grid view.


Backend Investigation

1. Publishing Requests Return HTTP 200

Nginx access logs show multiple publishing requests returning successful HTTP responses.

Example:

POST /api/workspace/{workspace_id}/publish HTTP/1.1
200 133

Despite these responses, the AppFlowy desktop client displays Error 1017.

This suggests the problem may involve application-level processing, response handling, or publishing-result verification.

2. AppFlowy Cloud Processes Publishing Requests

The backend logs show publishing requests reaching the following components:

appflowy_cloud_publishing::biz::workspace::publish_asset_rewriter
appflowy_cloud_publishing::api::workspace::publish

Example log entries:

Extracted 1 file references from document ...
Rewrote document assets for view_id=..., found 1 blob keys

These entries indicate that AppFlowy Cloud begins processing publishing operations.

No definitive publishing exception has been correlated with Error 1017.

3. Missing Parent View Errors

AppFlowy Cloud also reports errors involving missing parent database views.

Example:

RecordNotFound(
  "parent view ... not found in workspace ..."
)

Source:

libs/appflowy-cloud-pages/src/pages.rs
line_number: 1237

Handler:

post_page_database_view_handler

API endpoint:

POST /api/workspace/{workspace_id}/page-view/{view_id}/database-view

These errors may be related to linked database view handling, but a direct causal relationship with the publishing or duplication failure has not yet been confirmed.

4. Relevant Source Code Paths

The backend logs reference:

libs/appflowy-cloud-publishing/src/api/workspace/publish.rs
libs/appflowy-cloud-publishing/src/biz/workspace/publish_asset_rewriter.rs
libs/appflowy-cloud-pages/src/pages.rs

Areas worth investigating:

  • Linked database view resolution during publication.

  • Serialization and snapshot generation for database record pages.

  • Handling of source database and linked view identifiers.

  • Duplication of pages containing embedded linked database views.

  • Desktop publishing-result verification when the backend returns HTTP 200.


Impact

This issue prevents publishing individual Company database records that contain linked views of related Opportunities.

Linked database views are important for account management workflows because they allow users to display related records without duplicating the underlying data.

Removing these views restores publishing functionality but removes important contextual information from the page.

The issue also prevents duplicating affected database record pages.


Current Workaround

Remove the embedded linked database view before publishing or duplicating the page.

This is not a practical permanent workaround because the linked database view is required for normal workflows.

Regular independent inline grids do not trigger the problem.


Additional Findings

  • AppFlowy Desktop version: 0.15.0

  • AppFlowy Cloud version: 0.20.4

  • Docker services are running and healthy.

  • The publishing API returns HTTP 200.

  • Publishing works for normal pages and database entries without linked views.

  • New records reproduce the problem when a linked database view is added.

  • Removing the linked view restores publishing and duplication.

  • No Nginx publishing timeout was identified in the captured logs.

These findings suggest a reproducible issue in linked database view handling rather than a general infrastructure or authentication problem.


.

Dominant language
Dart
Stars
79.1k
Forks
6.3k
Avg merge
17h 29m
Merged PRs (30d)
1

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from AppFlowy-IO/AppFlowy

All issues in AppFlowy-IO/AppFlowy

Similar issues

More Dart issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.