Add IsLocal and Domain helper columns to ActorEntity for indexed locality queries#21
Draft
Add IsLocal and Domain helper columns to ActorEntity for indexed locality queries#21
Conversation
Co-authored-by: aluitink <3255752+aluitink@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Start implementation of MySQL persistence library
Add MySQL persistence driver via EF Core + Pomelo
Mar 8, 2026
…persistent actor sync queue Co-authored-by: aluitink <3255752+aluitink@users.noreply.github.com>
Copilot
AI
changed the title
Add MySQL persistence driver via EF Core + Pomelo
MySQL persistence: schema correctness fixes + provider-aware blobs + persistent actor sync queue
Mar 8, 2026
…hema Co-authored-by: aluitink <3255752+aluitink@users.noreply.github.com>
Copilot
AI
changed the title
MySQL persistence: schema correctness fixes + provider-aware blobs + persistent actor sync queue
MySQL persistence: proper relational schema with FK constraints, navigation properties, and structural fixes
Mar 8, 2026
Co-authored-by: aluitink <3255752+aluitink@users.noreply.github.com>
Copilot
AI
changed the title
MySQL persistence: proper relational schema with FK constraints, navigation properties, and structural fixes
MySQL schema: FK constraints, navigation properties, and actor query helper fields
Mar 8, 2026
Copilot
AI
changed the title
MySQL schema: FK constraints, navigation properties, and actor query helper fields
Add IsLocal and Domain helper columns to ActorEntity for indexed locality queries
Mar 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
Actorstable stores both local and remote actors, but distinguishing them required runtimeactorId.StartsWith(baseUrl)string comparisons with no DB-level filter.GetAllLocalUsernamesAsyncandCountLocalActorsAsyncreturned all rows and relied on theUsername != 'sys'workaround.Schema changes (
ActorEntity/BrocaDbContext)IsLocal bool(indexed) — set on save by checkingactor.Idagainst the configuredBaseUrl. EnablesWHERE IsLocal = 1instead of in-process URL filtering.Domain varchar(255)(indexed) — hostname extracted from the actor ID URI. Enables domain-based queries (federation blocks, per-domain stats) withoutLIKE '%...'scans over the JSON blob.Repository changes (
MySqlActorRepository)IOptions<ActivityPubServerOptions>to compute locality at save time; warns whenBaseUrlis unconfigured or an actor ID can't be parsed.SaveActorAsyncpopulates both fields on create and update.GetAllLocalUsernamesAsync— changed from full-table scan toWHERE IsLocal = true.CountLocalActorsAsync— changed fromWHERE Username != 'sys'toWHERE IsLocal = true AND Username != 'sys', correctly excluding remote actors from the local user count.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com/graphql/usr/bin/gh gh pr edit 21 --repo aluitink/Broca --base develop(http block)https://api.github.com/repos/aluitink/Broca/pulls/21/usr/bin/curl curl -s -X PATCH -H Authorization: ****** -H Accept: application/vnd.github+json -H X-GitHub-Api-Version: 2022-11-28 REDACTED -d {"base":"develop"}(http block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
Start implementation
The user has attached the following file paths as relevant context:
- .github/copilot-instructions.md
[Chronological Review: The conversation began with the user requesting a review of the project and planning for a MySQL persistence library. They specified the need for a schema based on current project requirements and mentioned using EF Core with a third-party MySQL driver. The user also expressed interest in including a MySQL database container for Docker. The user then requested to start the implementation of the library.][Intent Mapping:
[Technical Inventory:
[Code Archaeology:
[Progress Assessment:
[Context Validation: All necessary context for continuing the project has been captured, including technology choices and user goals.]
[Recent Commands Analysis:
1. Conversation Overview: - Primary Objectives: The user aims to create a MySQL persistence library for their .NET project, including a relevant schema and integration with Docker. - Session Context: The conversation has transitioned from planning the library to initiating its implementation. - User Intent Evolution: The user has moved from discussing requirements to actively requesting the start of the implementation phase.- Technical Foundation:
- .NET: The framework being used for the project.
- EF Core: The ORM selected for database interactions.
- MySQL: The database system intended for use.
- Docker: The platform for containerization and deployment.
- Codebase Status:
- /mnt/sdb/src/Broca/tests/Broca.ActivityPub.IntegrationTests/ServerToServerTests.cs:
- Purpose: This file is part of the integration tests for the project.
- Current State: No specific modifications have been made yet in this session.
- Key Code Segments: Not applicable as no changes have been documented.
- Dependencies: This file is likely dependent on the overall project structure and the new persistence library.
- Problem Resolution:
- Issues Encountered: No specific technical problems have been documented yet.
- Solutions Implemented: The user has outlined the requirements for the persistence library.
- Debugging Context: No ongoing troubleshooting efforts have been noted.
- Lessons Learned: No insights have been documented yet.
- Progress Tracking:
- Completed Tasks: User has defined the requirements for the MySQL persistence library.
- Partially Complete Work: The implementation has been requested but not yet detailed.
- Validated Outcomes: No features or code have been confirmed working through testing yet.
- Active Work State:
- Current Focus: The user is focused on starting the implementation of the MySQL persistence library.
- Recent Context: The last few exchanges involved planning the library and requesting to start its implementation.
- Working Code: No specific code snippets have been discussed recently.
- Immediate Context: The user was preparing to begin the implementation of the persistence library.
- Recent Operations:
- Last Agent Commands: User requested to "Start implementation."
- Tool Results Summary: No specific results were generated from this command.
- Pre-Summary State: The agent was discussing the implementation of the MySQL persistence library.
- Operation Context: The recent commands were aimed at progressing towards the development of the persistence library.
- Continuati...
Created from VS Code.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.