-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Follow-up from #463
- Check code coverage and possibly remove dead code
- Refactor
hfs-server
to update event durations in a simpler way (and get rid of all the bloat liketprpc
…)⚠️ First see about replacing InfluxDB with SQLite??? - Review code structure consistency: there's an issue with conflictual (non-orthogonal) aspects, e.g. what exactly differentiates "business" from "platform"?
- Check
openSource
/dnsLess
settings disseminated all around: ultimately core must be DNS-less and that logic belongs to Nginx - Check code internals like supposedly private members (e.g.
mall.stores
) being routinely used elsewhere (and not only in tests, which is bad enough) – clean up components encapsulation - See root
await
& Unify singleton patterns (possible solutions below) - Consider cleaning up
api-server
tests organisation:test/
vsacceptance/
,unit/
etc. - Similarly, consider Refactor: data stores knowledge must be confined to storage (mall) #435
Possible solutions for singletons
Just unify current singleton patterns, e.g.
const lazyInit = (fn) => {
let promise = undefined;
return () => promise = (promise || fn());
}
const getVersion = lazyInit(async () => {
const programVersion = await version();
return programVersion;
});
console.log(`Version is: ${await getVersion()}`);
Top-level await
- Pro: cleanest ultimately
- Con: loads of work
Init all at boot, then just synchronous require()
(this is actually partially used in Application.js
)
- Con: then all exposed methods must check for init state…
Broken encapsulation of components code
Other components referencing each other's internal code… the mess! E.g. this example found in components/audit/src/methods/audit-logs.js
:
const commonFns = require('api-server/src/methods/helpers/commonFunctions');
const methodsSchema = require('../schema/auditMethods');
const eventsGetUtils = require('api-server/src/methods/helpers/eventsGetUtils');
const mallEventsGetUtils = require('mall/src/lib/eventsGetUtils');
import type { GetEventsParams } from 'api-server/src/methods/helpers/eventsGetUtils';
import type { StreamQuery } from 'business/src/events';
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
Ready