Commit Graph

17 Commits

Author SHA1 Message Date
a0af019ea0 fix: remove redundant json serialization round-trip in BaseView.insert method 2025-01-02 19:44:01 +00:00
53371d6ea6 fix: convert datetime.now() to string before upsert in BaseView record creation 2025-01-02 19:43:09 +00:00
98d45789f6 fix: convert datetime.now() to string before storing in database records 2025-01-02 19:42:10 +00:00
2043b8b4e2 fix: serialize datetime objects to string in insert method of BaseView 2025-01-02 19:41:09 +00:00
d4a26d730d fix: ensure dict data is JSON-serializable before inserting into database
The diff shows a change in `src/metriki/app.py` within the `BaseView.insert` method. The original code directly passed `dict(data)` to the database insert, which could fail if `data` contains non-serializable types like `datetime` objects. The fix converts the data to a JSON string and back using `json.loads(json.dumps(data))`, ensuring all values are plain Python types (strings, numbers, lists, dicts) before insertion. This prevents serialization errors when the database backend expects JSON-compatible data.
2025-01-02 19:40:21 +00:00
335656dcc1 chore: replace keyword argument unpacking with dict() call in BaseView.insert method 2025-01-02 19:34:41 +00:00
35fe1b91d0 fix: correct insert method call to unpack data dict as keyword arguments in BaseView 2025-01-02 19:32:44 +00:00
cc0fc11407 fix: add reconnection logic and guard in Metriki emit methods
- Wrap ws.send in try-catch to handle connection failures gracefully
- Set isConnected to false and schedule retry via emitVisit after 500ms on error
- Add early return guard in emitVisit to skip emission when not rendered or connected
2025-01-02 19:30:00 +00:00
d5359176f6 chore: replace hardcoded WebSocket URL with wss://metriki.molodetz.nl/event endpoint in Metriki class constructor 2025-01-02 19:20:57 +00:00
a85719a8aa feat: add initial index.html template with Metriki title and static JS include 2025-01-02 19:14:43 +00:00
66671fe1b3 chore: remove console.info and console.log debug statements from Metriki class 2025-01-02 19:00:46 +00:00
786e757458 feat: add click event detection and storage to EventView handler
Introduce a new `click_fields` list alongside existing document fields, implement `is_click_record` method to identify click events by checking for 'click' event type, and extend `get_record` to extract click-specific fields. In the `post` method, route click records to a new 'click' collection with associated visit_id, enabling separate storage and analysis of click interactions distinct from document and general event records.
2025-01-02 18:59:59 +00:00
a0077ee13f feat: replace session_id with ip for session lookup and add scroll/mouse event fields to JS tracker 2025-01-02 18:54:24 +00:00
ad124188de fix: correct console_scripts entry point names and replace placeholder bot logic with aiohttp web server 2025-01-02 18:28:33 +00:00
865bdc9a05 chore: remove booehbot matrix client and add aiohttp web app scaffold with session views 2025-01-02 17:43:04 +00:00
3c176c7e14 chore: rename project from boeh to metriki and update entry points and dependencies 2025-01-02 16:21:56 +00:00
05cba47325 feat: scaffold boeh matrix bot with async client, env secrets, and makefile build pipeline 2025-01-02 16:17:17 +00:00