Skip to content

fix syncids#220

Merged
spashii merged 1 commit intomainfrom
hotfix/directus-jul-16
Jul 16, 2025
Merged

fix syncids#220
spashii merged 1 commit intomainfrom
hotfix/directus-jul-16

Conversation

@spashii
Copy link
Copy Markdown
Member

@spashii spashii commented Jul 16, 2025

Summary by CodeRabbit

  • Chores
    • Updated internal identifiers for workflow operations and settings. No visible changes to features or user experience.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Jul 16, 2025

Walkthrough

UUIDs for operations, flows, and settings in several Directus JSON config files were rotated to new values. No business logic, structure, or functional code was changed—just identifier updates for sync, operation, and flow references.

Changes

File(s) Change Summary
echo/directus/sync/collections/flows.json Updated "operation" UUIDs for "Send Email" and "Send Report Emails" flows.
echo/directus/sync/collections/operations.json Rotated UUIDs for "resolve", "reject", and "_syncId" fields across multiple operations.
echo/directus/sync/collections/settings.json Changed the "_syncId" value in settings JSON.

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@spashii spashii added this pull request to the merge queue Jul 16, 2025
Merged via the queue into main with commit 7fe142e Jul 16, 2025
11 of 12 checks passed
Copy link
Copy Markdown
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: 3

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 994d9c7 and ac54af8.

📒 Files selected for processing (3)
  • echo/directus/sync/collections/flows.json (2 hunks)
  • echo/directus/sync/collections/operations.json (15 hunks)
  • echo/directus/sync/collections/settings.json (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: spashii
PR: Dembrane/echo#142
File: echo/frontend/src/lib/query.ts:730-740
Timestamp: 2025-05-13T15:18:29.107Z
Learning: When working with Directus API in this codebase, foreign key relationships must be specified using nested objects with `id` properties (e.g., `conversation_id: { id: conversationId } as Conversation`) rather than direct ID values, even though this appears redundant.
echo/directus/sync/collections/operations.json (1)
Learnt from: spashii
PR: Dembrane/echo#142
File: echo/frontend/src/lib/query.ts:730-740
Timestamp: 2025-05-13T15:18:29.107Z
Learning: When working with Directus API in this codebase, foreign key relationships must be specified using nested objects with `id` properties (e.g., `conversation_id: { id: conversationId } as Conversation`) rather than direct ID values, even though this appears redundant.
⏰ 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: ci-check-server
🔇 Additional comments (1)
echo/directus/sync/collections/settings.json (1)

67-67: LGTM – rotated _syncId looks fine.

Just make sure the new identifier is loaded into the target Directus instance ( npx directus sync apply ) before any content edits, otherwise subsequent diffs will explode.

Comment on lines +53 to 54
"operation": "239c6fea-242d-4b7d-b854-c99d2fe43cf3",
"_syncId": "ec4e7ea5-72de-4365-b66f-d8f11b549495"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick (assertive)

Second operation link updated – run the same cross-check.

239c6fea-242d-4b7d-b854-c99d2fe43cf3 should likewise exist exactly once.

🤖 Prompt for AI Agents
In echo/directus/sync/collections/flows.json around lines 53 to 54, verify that
the operation ID "239c6fea-242d-4b7d-b854-c99d2fe43cf3" appears exactly once in
the file. If duplicates exist, remove or correct them to ensure this operation
ID is unique within the collection.

Comment on lines +11 to 12
"operation": "5bea9e07-e6f0-41c6-821d-b426dec3427c",
"_syncId": "17703446-fef0-49e9-bdc4-385db1311137"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Updated operation UUID – sanity-check reference exists.

5bea9e07-e6f0-41c6-821d-b426dec3427c must point to an operation object in operations.json. Looks present, but a quick grep never hurts.


🏁 Script executed:

#!/usr/bin/env bash
# Verify that every operation ID referenced from flows exists once in operations.json
jq -r '.[].operation' echo/directus/sync/collections/flows.json |
  grep -v null |
  while read op; do
    count=$(jq -r --arg op "$op" '[.[].key] | length' echo/directus/sync/collections/operations.json)
    if [[ "$count" -eq 0 ]]; then echo "✗ missing $op"; fi
  done

Length of output: 412


Let’s correct the filter and re-run the check to ensure we’re matching on .key:


🏁 Script executed:

#!/usr/bin/env bash
# Verify every “operation” in flows.json actually exists in operations.json
jq -r '.[].operation' echo/directus/sync/collections/flows.json \
  | grep -v null \
  | sort -u \
  | while read op; do
      if ! jq -e --arg op "$op" 'any(.[]; .key == $op)' echo/directus/sync/collections/operations.json > /dev/null; then
        echo "✗ missing $op"
      fi
    done

Length of output: 576


Missing operation UUIDs in operations.json
The following IDs in echo/directus/sync/collections/flows.json (lines 11–12) aren’t present in echo/directus/sync/collections/operations.json:

  • 239c6fea-242d-4b7d-b854-c99d2fe43cf3
  • 5bea9e07-e6f0-41c6-821d-b426dec3427c

Please add these operation objects to operations.json (or correct the UUIDs in flows.json). LGTM once addressed.

🤖 Prompt for AI Agents
In echo/directus/sync/collections/flows.json at lines 11 to 12, the operation
UUIDs referenced are missing from
echo/directus/sync/collections/operations.json. To fix this, either add the
corresponding operation objects with these UUIDs to operations.json or update
the UUIDs in flows.json to match existing entries in operations.json, ensuring
all referenced operations are valid and present.

Comment on lines +17 to 21
"resolve": "3dbf2ea1-17f8-4bde-aa89-43278fe9a00f",
"reject": "eaeb2c39-32e0-428d-ad03-ff0e6052adcc",
"flow": "17703446-fef0-49e9-bdc4-385db1311137",
"_syncId": "11fdc301-7101-40f3-bc82-af3b472fd914"
"_syncId": "5bea9e07-e6f0-41c6-821d-b426dec3427c"
},
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Bulk UUID rotation LGTM – but guard against dupes / orphans.

Nothing functional changed; just IDs. Before shipping, run a quick validator to ensure:

  1. every _syncId is globally unique,
  2. every resolve/reject points at an existing _syncId,
  3. no flow/operation references are dangling.

Also applies to: 43-47, 63-67, 80-81, 94-95, 108-109, 119-123, 146-150, 163-164, 182-186, 205-209, 222-223, 251-254, 282-285, 300-301


🏁 Script executed:

#!/usr/bin/env python
"""
Cross-validate Directus sync IDs & operation references.
"""
import json, pathlib, sys, collections, itertools, sys

base = pathlib.Path("echo/directus/sync/collections")
files = list(base.glob("*.json"))

# Load all arrays
data = {}
for f in files:
    data[f.stem] = json.loads(f.read_text())

# 1. global uniqueness for _syncId
sync_ids = [item["_syncId"] for items in data.values() for item in items if "_syncId" in item]
dupes = [x for x, n in collections.Counter(sync_ids).items() if n > 1]
if dupes:
    print("✗ duplicate _syncId:", dupes)

# 2. build lookup of _syncId → item
lookup = {item["_syncId"]: item for items in data.values() for item in items if "_syncId" in item}

# 3. Check resolve/reject pointers
bad = []
for op in data["operations"]:
    for field in ("resolve", "reject"):
        ref = op.get(field)
        if ref and ref not in lookup:
            bad.append((op["key"], field, ref))
if bad:
    print("✗ dangling refs:", bad)

# 4. Check flow.operation links
for flow in data["flows"]:
    op_id = flow.get("operation")
    if op_id and op_id not in lookup:
        print("✗ flow", flow["name"], "points to missing operation", op_id)

if not (dupes or bad):
    print("✓ all good")

Length of output: 607


🏁 Script executed:

#!/usr/bin/env bash
python3 - << 'EOF'
import json, pathlib, collections

base = pathlib.Path("echo/directus/sync/collections")
files = list(base.glob("*.json"))

# Load all JSON files
data = {}
for f in files:
    data[f.stem] = json.loads(f.read_text())

# 1. Global uniqueness for _syncId
sync_ids = [item["_syncId"] for items in data.values() for item in items if "_syncId" in item]
dupes = [x for x, n in collections.Counter(sync_ids).items() if n > 1]
if dupes:
    print("✗ duplicate _syncId:", dupes)

# 2. Build lookup of _syncId → item
lookup = {item["_syncId"]: item for items in data.values() for item in items if "_syncId" in item}

# 3. Check resolve/reject pointers in operations.json
bad_refs = []
for op in data.get("operations", []):
    for field in ("resolve", "reject"):
        ref = op.get(field)
        if ref and ref not in lookup:
            bad_refs.append((op.get("key"), field, ref))
if bad_refs:
    print("✗ dangling refs in operations:", bad_refs)

# 4. Check flow → operation links in flows.json
dangling_flows = []
for flow in data.get("flows", []):
    op_id = flow.get("operation")
    if op_id and op_id not in lookup:
        dangling_flows.append((flow.get("name"), op_id))
if dangling_flows:
    for name, op_id in dangling_flows:
        print(f"✗ flow '{name}' points to missing operation: {op_id}")

# Final result
if not (dupes or bad_refs or dangling_flows):
    print("✓ all good")
EOF

Length of output: 73


🏁 Script executed:

#!/usr/bin/env bash
grep -R "2446660a-ab6c-4801-ad69-5711030cba83" -n echo/directus/sync/collections/*.json

Length of output: 10000


Duplicate _syncId Detected – Action Required

We’ve uncovered that _syncId: "2446660a-ab6c-4801-ad69-5711030cba83" is defined twice, which violates global uniqueness:

  • echo/directus/sync/collections/policies.json: _syncId at line 48
  • echo/directus/sync/collections/roles.json: _syncId at line 14
    – also used as parent at line 27
  • referenced extensively under policy in permissions.json

Please regenerate a fresh UUID for one of these entries (and update any pointers, e.g. parent or policy fields), then rerun the validator script to confirm no more duplicates or dangling refs.

🤖 Prompt for AI Agents
In echo/directus/sync/collections/policies.json line 48 and
echo/directus/sync/collections/roles.json line 14, the _syncId
"2446660a-ab6c-4801-ad69-5711030cba83" is duplicated, violating uniqueness.
Generate a new UUID for one of these _syncId values, update all references to it
including the parent field at line 27 in roles.json and any policy references in
permissions.json, then rerun the validator to ensure no duplicates or broken
references remain.

@spashii spashii deleted the hotfix/directus-jul-16 branch October 30, 2025 12:03
spashii added a commit that referenced this pull request Nov 18, 2025
@coderabbitai coderabbitai bot mentioned this pull request Dec 9, 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