Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@KernelDeimos
Copy link
Contributor

@KernelDeimos KernelDeimos commented Dec 24, 2025

Scope

This PR covers implementing the apps driver, which will replace the es:apps driver.

  • Later, es:subdomains and es:notifications will separately be moved away from the EntityStorage system.
  • This PR only covers es:apps.

Process/Convention Notes

  • This PR is regularly rebased on main.
  • Commits are intended to be well-formed, so this PR should be merged with the "Rebase and merge" option.

Method Implementations

  • apps.select()
  • apps.read()
  • apps.create()
  • apps.update()
  • apps.upsert()
  • apps.delete()

Regression Discovery

  • Write regression tests .select() to test es:app -> app
  • Write regression tests .read() to test es:app -> app
  • Write regression tests .create() to test es:app -> app
  • Write regression tests .update() to test es:app -> app
  • Write regression tests .upsert() to test es:app -> app
  • Write regression tests .delete() to test es:app -> app

Regression Fixes

this list will be populated later

Other Tasks

  • Test/implement protected apps support
  • Manual access policy testing

@KernelDeimos KernelDeimos marked this pull request as draft December 24, 2025 00:13
@KernelDeimos KernelDeimos changed the title Data access simplifications Data access simplifications (part 1: apps driver) Dec 24, 2025
@KernelDeimos KernelDeimos force-pushed the eric/25CN0-entity-refactor branch 2 times, most recently from 6167b41 to bb96940 Compare December 29, 2025 23:19
Adds `as_bool` utility function for boolean values from MySQL and
Sqlite, based on the previous implementatoin for ES/OM.
It turns out self-referencing tables add some nuances to what is and
what isn't ambiguous in SQL queries, so getting this right took a little
longer than expected. Following the entire chain doesn't seem to be
possible so a compromise is made by only traversing one level of depth.
(you can the uid of the owner of the app, but not the uid of the owner
app's own owner)
Adds the `icon_size` parameter to the `.select()` method on the new
non-ES/OM implementation.

When adding the necessary `params` parameter to the `.select()`
method, it was noticed that the `predicate` parameter did not have a
default value - potentially causing a regression; a default value was
set for both `params` and `predicate`.
Most of this implementation matched `.select()` which saved time. The
common behavior can be factored out, but since the purpose of this
refactor is to flatten everything as much as possible I'm going to leave
the duplicated code and make a note to do this later.

The challenging part was `#build_complex_id_where()`, which is the
equivalent to the `fetch_based_on_complex_id_()` method in
EntityStoreService. This allows `uid: app-UUID-OF-APP` and `id: { name:
'editor' }` to both work.
Fixes are also included for a couple issues that were found:
- `null` being included in extensions list
- property called `user_owner` instead of `owner`
DRY some redundant code and use guard clauses where applicable.
Primarily these tests were AI generated an then checked over for sanity.
These tests are good unit tests to avoid regressions as a result of
changes to this code but are not sufficient to test for regressions
introduced by this new implementation that will replace `es:app`.
This is a naive implementation of the `.upsert()` method that simply
calls `.create()` or `.update()` depending on whether or not the app
already exists.
@KernelDeimos KernelDeimos force-pushed the eric/25CN0-entity-refactor branch from bb96940 to 5bba01b Compare December 30, 2025 22:24
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