Skip to content

Conversation

@danielkweon
Copy link
Contributor

@danielkweon danielkweon commented Dec 4, 2025

add [properties-be] - properties service handling system

This branch adds support for system properties - properties that are managed by the system rather than users/organizations.

  • Added System owner type for properties - Property definitions can now be owned by the system (in addition to users/organizations), with a new is_system flag on property definitions
  • System properties are read-only - Users cannot delete system property definitions or modify their options
  • System property values can be modified but not deleted - Values on entities can be set/updated, but deleting is not supported
  • API supports listing system properties - Added System scope to the property definitions list endpoint

frontend works as is - changes are backwards compatible. but frontend changes to handle system properties incoming as well
Screenshot 2025-12-04 at 5 54 37 PM

- Modified get_entity_type_from_entity_property to exclude system properties
  by joining property_definitions and filtering on is_system = FALSE
- System properties now return 404 Not Found when deletion is attempted
- System property values can still be modified via set endpoint
- Added documentation explaining this behavior
@danielkweon danielkweon self-assigned this Dec 4, 2025
@danielkweon danielkweon requested a review from a team as a code owner December 4, 2025 22:36
@linear
Copy link

linear bot commented Dec 4, 2025

Fields already captured by #[tracing::instrument] are now removed from
individual log statements to avoid duplication in traces.
@evanhutnik
Copy link
Contributor

System property values can be modified but not deleted - Values on entities can be set/updated, but deleting is not supported

So system properties like created_at and updated_at can be edited manually by the user? That doesn't make much sense to me. +1 to hutch's concerns about keeping these in sync with the document metadata (and search for that matter). I don't think metadata that exists elsewhere on an item (name, created_at, updated_at) should also be a property for these reasons

404 responses are normal client errors and don't need to be logged.
Simplify ok_or_else closures to plain ok_or calls.
… logging

Add err attribute to all #[tracing::instrument] macros to automatically
log errors on function return. Remove redundant manual tracing calls
before error returns.
Replace 'Database error: {0}' with generic 'An internal error occurred'
to avoid leaking internal database details to API clients. Errors are
still logged server-side via instrument(err).
- Use 'An internal error occurred' for all internal/database errors
- Use '[Entity] not found' pattern for not-found errors (capitalized)
- Use 'Access denied' for permission errors (no details leaked)
- Use '{0}' passthrough for nested errors and validation messages
- Consistent capitalization across all error messages
@danielkweon
Copy link
Contributor Author

metadata are derived fields (e.g. owner, created_at, updated_at). these are not stored in properties db
properties service retrieves it, bc when the user sees properties in a markdown file - they also want to see metadata

@danielkweon danielkweon merged commit 6ce17bc into main Dec 5, 2025
34 checks passed
@danielkweon danielkweon deleted the daniel/m-5328--add-properties-backed-properties-service-handling-system branch December 5, 2025 23:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants