vjekob / al-objid

Manage object IDs in multi-user environments with mind-boggling simplicity.
MIT License
29 stars 17 forks source link

Refactoring: Backend class should work on ALApp instance, rather than app hash #42

Open vjekob opened 2 years ago

vjekob commented 2 years ago

Partly, this is related to #41 and it certainly depends on it being done first.

Currently, Backend class receives app hash as parameter for all back-end operations. Furthermore, it processes app ID and pool ID decisions directly. This class, just like the back end itself, should not even consider pools, it should simply access the hash property that should (as per #41) return pool ID when an app is in a pool.

At this particular point, there is an accidental infinite loop in telemetry during app initialization (not in production, don't worry!) simply because app ID is passed to telemetry from app initialization, but then Backend class attempts to re-initialize the app because it doesn't know about the app, only about its hash. While this is a simple issue to fix, the root cause is deeper, and is twofold:

This would then provide for a much cleaner structure, easier to reuse and extend.