Skip to content

Conversation

@appflowy
Copy link
Contributor

@appflowy appflowy commented Dec 2, 2025

Description


Checklist

General

  • I've included relevant documentation or comments for the changes introduced.
  • I've tested the changes in multiple environments (e.g., different browsers, operating systems).

Testing

  • I've added or updated tests to validate the changes introduced for AppFlowy Web.

Feature-Specific

  • For feature additions, I've added a preview (video, screenshot, or demo) in the "Feature Preview" section.
  • I've verified that this feature integrates seamlessly with existing functionality.

Summary by Sourcery

Improve logging for page creation and API responses, adjust UI layout for database items in the slash panel, and stabilize a publish page E2E test.

Bug Fixes:

  • Stabilize the publish page management panel E2E assertion to avoid null subject issues.

Enhancements:

  • Add detailed debug logging around generic API execution responses, including response metadata.
  • Add debug logging around the new page creation flow to trace requests and responses.
  • Adjust the database tree item page icon styling in the slash panel for consistent sizing and alignment.

Tests:

  • Update the publish page Cypress test to assert panel existence and visibility separately before checking its content.

@sourcery-ai
Copy link

sourcery-ai bot commented Dec 2, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Enhances logging around HTTP API requests and new page creation, stabilizes a publish-page Cypress test assertion, and slightly adjusts the slash panel database tree item icon layout for better rendering.

File-Level Changes

Change Details Files
Improve observability for API requests and new page creation to aid debugging.
  • Extend executeAPIRequest debug log to include response payload fields (data, code, message).
  • Add debug logs before and after addAppPage to capture request parameters and key response identifiers.
  • Add a debug log in NewPage.handleAddPage to record the parentId and layout used when creating a new page.
src/application/services/js-services/http/http_api.ts
src/components/app/view-actions/NewPage.tsx
Stabilize the publish page Cypress test to avoid null subject errors when asserting on the publish manage panel.
  • Split chained Cypress assertions into separate existence and visibility checks for publishManagePanel before asserting it contains the expected text.
cypress/e2e/page/publish-page.cy.ts
Adjust styling of the page icon in the slash panel database tree for more consistent sizing and alignment.
  • Pass a className to PageIcon to enforce flex layout and fixed 20x20 dimensions with centered content.
src/components/editor/components/panels/slash-panel/SlashPanel.tsx

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey there - I've reviewed your changes - here's some feedback:

  • The new Log.debug('[executeAPIRequest]', { ..., response_data: response.data?.data, ... }) call may end up logging large payloads or sensitive data; consider logging only metadata (e.g., sizes, IDs, codes) or guarding it behind a more verbose log level flag.
  • In addAppPage, you now log the full request payload including name; if this can contain user-entered or sensitive content, consider redacting or truncating it before logging.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The new `Log.debug('[executeAPIRequest]', { ..., response_data: response.data?.data, ... })` call may end up logging large payloads or sensitive data; consider logging only metadata (e.g., sizes, IDs, codes) or guarding it behind a more verbose log level flag.
- In `addAppPage`, you now log the full request payload including `name`; if this can contain user-entered or sensitive content, consider redacting or truncating it before logging.

## Individual Comments

### Comment 1
<location> `src/application/services/js-services/http/http_api.ts:159` </location>
<code_context>
     const method = response.config?.method?.toUpperCase() || 'UNKNOWN';

-    Log.debug('[executeAPIRequest]', { method, url: requestUrl });
+    Log.debug('[executeAPIRequest]', { method, url: requestUrl, response_data: response.data?.data, response_code: response.data?.code, response_message: response.data?.message });

     if (!response.data) {
</code_context>

<issue_to_address>
**🚨 suggestion (security):** Consider narrowing or guarding the logged response payload to avoid excessive or sensitive data in logs.

Logging `response.data?.data` and `message` risks putting large or sensitive user content into logs. If you only need this for debugging, consider limiting logs to metadata (e.g., status code, flags, payload size), or conditionally logging detailed data behind a debug flag/env check, or truncating/sanitizing the payload first.

```suggestion
    Log.debug('[executeAPIRequest]', {
      method,
      url: requestUrl,
      response_code: response.data?.code,
      has_data: Boolean(response.data?.data),
      message_length: response.data?.message ? String(response.data.message).length : 0,
    });
```
</issue_to_address>

### Comment 2
<location> `src/application/services/js-services/http/http_api.ts:1443-1447` </location>
<code_context>
   const url = `/api/workspace/${workspaceId}/page-view`;

-  return executeAPIRequest<CreatePageResponse>(() =>
+  Log.debug('[addAppPage] request', { url, workspaceId, parentViewId, layout, name });
+
+  const response = await executeAPIRequest<CreatePageResponse>(() =>
</code_context>

<issue_to_address>
**🚨 suggestion (security):** Review whether `name` (and possibly other identifiers) should be logged for privacy and log-noise reasons.

Since `name` may contain user-entered content, logging it alongside `workspaceId` and `parentViewId` can expose user data and add log noise. If these logs are only for operational debugging, consider logging just IDs/layout, or masking/truncating `name` so full user strings aren’t persisted in logs.

```suggestion
  const url = `/api/workspace/${workspaceId}/page-view`;

  // Avoid logging full user-entered `name` to reduce PII exposure and log noise.
  Log.debug('[addAppPage] request', {
    url,
    workspaceId,
    parentViewId,
    layout,
    hasName: Boolean(name),
    nameLength: typeof name === 'string' ? name.length : undefined,
  });

  const response = await executeAPIRequest<CreatePageResponse>(() =>
```
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

const method = response.config?.method?.toUpperCase() || 'UNKNOWN';

Log.debug('[executeAPIRequest]', { method, url: requestUrl });
Log.debug('[executeAPIRequest]', { method, url: requestUrl, response_data: response.data?.data, response_code: response.data?.code, response_message: response.data?.message });
Copy link

Choose a reason for hiding this comment

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

🚨 suggestion (security): Consider narrowing or guarding the logged response payload to avoid excessive or sensitive data in logs.

Logging response.data?.data and message risks putting large or sensitive user content into logs. If you only need this for debugging, consider limiting logs to metadata (e.g., status code, flags, payload size), or conditionally logging detailed data behind a debug flag/env check, or truncating/sanitizing the payload first.

Suggested change
Log.debug('[executeAPIRequest]', { method, url: requestUrl, response_data: response.data?.data, response_code: response.data?.code, response_message: response.data?.message });
Log.debug('[executeAPIRequest]', {
method,
url: requestUrl,
response_code: response.data?.code,
has_data: Boolean(response.data?.data),
message_length: response.data?.message ? String(response.data.message).length : 0,
});

Comment on lines 1443 to +1447
const url = `/api/workspace/${workspaceId}/page-view`;

return executeAPIRequest<CreatePageResponse>(() =>
Log.debug('[addAppPage] request', { url, workspaceId, parentViewId, layout, name });

const response = await executeAPIRequest<CreatePageResponse>(() =>
Copy link

Choose a reason for hiding this comment

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

🚨 suggestion (security): Review whether name (and possibly other identifiers) should be logged for privacy and log-noise reasons.

Since name may contain user-entered content, logging it alongside workspaceId and parentViewId can expose user data and add log noise. If these logs are only for operational debugging, consider logging just IDs/layout, or masking/truncating name so full user strings aren’t persisted in logs.

Suggested change
const url = `/api/workspace/${workspaceId}/page-view`;
return executeAPIRequest<CreatePageResponse>(() =>
Log.debug('[addAppPage] request', { url, workspaceId, parentViewId, layout, name });
const response = await executeAPIRequest<CreatePageResponse>(() =>
const url = `/api/workspace/${workspaceId}/page-view`;
// Avoid logging full user-entered `name` to reduce PII exposure and log noise.
Log.debug('[addAppPage] request', {
url,
workspaceId,
parentViewId,
layout,
hasName: Boolean(name),
nameLength: typeof name === 'string' ? name.length : undefined,
});
const response = await executeAPIRequest<CreatePageResponse>(() =>

@appflowy appflowy merged commit 9b98a2b into main Dec 2, 2025
11 of 12 checks passed
@appflowy appflowy deleted the fix_page_icon_resize branch December 2, 2025 16:25
josue693 pushed a commit to josue693/AppFlowy-Web that referenced this pull request Dec 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants