Skip to content

fix: strip unknown internal attributes during migration#200

Open
deepshekhardas wants to merge 1 commit into
utopia-php:mainfrom
deepshekhardas:fix/strip-internal-sequence-field
Open

fix: strip unknown internal attributes during migration#200
deepshekhardas wants to merge 1 commit into
utopia-php:mainfrom
deepshekhardas:fix/strip-internal-sequence-field

Conversation

@deepshekhardas

Copy link
Copy Markdown

Description

Fixes internal attribute leakage during Appwrite-to-Appwrite migration, which causes Invalid document structure: Unknown attribute: "" errors.

Changes

Source (Appwrite.php)

  • Added $internalId to the list of stripped internal fields when exporting records

Destination (Appwrite.php)

  • Replaced blind continue for all $-prefixed fields with an explicit allowlist ($id, $permissions, $collection, $tenant, $createdAt, $updatedAt)
  • Unknown $-prefixed fields (e.g. $sequence from older sources, $databaseId, $tableId, $internalId) are now stripped before document creation, preventing Structure validator rejections

Related Issues

Source (Appwrite.php): add  to the list of stripped internal
fields when exporting records, preventing it from leaking into row data.

Destination (Appwrite.php): replace blind skip of all $-prefixed fields
with an explicit allowlist of known internal attributes (, ,
, , , ). Unknown $-prefixed fields
(e.g.  from older sources, , , )
are now stripped before document creation, preventing Structure validator
rejections.

Fixes appwrite/appwrite#10265
@greptile-apps

greptile-apps Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR strips Appwrite internal row metadata during migration. The main changes are:

  • Removes $internalId from Appwrite source row exports.
  • Drops unknown $-prefixed fields before destination row writes.
  • Keeps only supported internal row fields such as $id, $permissions, and timestamps.

Confidence Score: 5/5

The migration changes are narrowly scoped and safe to merge.

No correctness issues were identified in the changed source and destination filtering logic.

T-Rex T-Rex Logs

What T-Rex did

  • T-Rex compared the before and after internal-attributes logs to verify how the system tracks source attributes and destination allowlists.
  • The comparison shows that the after state detects a new source unset and a proper destination allowlist, and that export now preserves only the user field name while destination cleanup retains only allowlisted metadata plus the declared name, with validation reporting no unknown attributes.

View all artifacts

T-Rex Ran code and verified through T-Rex

Reviews (1): Last reviewed commit: "fix: strip unknown internal attributes d..." | Re-trigger Greptile

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.

🐛 Bug Report: Invalid document structure: Unknown attribute: "$sequence"

1 participant