Commit Graph

37 Commits

Author SHA1 Message Date
Michael Weimann
5398db21ad
Add ESLint Jest (#10261) 2023-03-01 16:23:35 +01:00
Michael Telatynski
e8b92b308b
Conform more code to strict null checking (#10169)
* Conform more code to strict null checking

* delint

* Iterate

* delint

* Fix bad test
2023-02-16 09:38:44 +00:00
Michael Telatynski
61a63e47f4
Comply with noImplicitAny (#9940)
* Stash noImplicitAny work

* Stash

* Fix imports

* Iterate

* Fix tests

* Delint

* Fix tests
2023-02-13 11:39:16 +00:00
Michael Weimann
526645c791
Apply prettier formatting 2022-12-12 12:24:14 +01:00
Michael Telatynski
28ecdc0cb4
Send layout analytics as WebLayout (#9482) 2022-11-04 09:10:37 +00:00
CommanderRoot
c35fc169f5
Replace deprecated String#substr with String#slice (#8314) 2022-04-14 07:52:42 +00:00
Kerry
a8d65ab5c5
Include /test in tsc config, fix rest of issues (#8119)
* fix ts issue in PosthogAnalytics test

Signed-off-by: Kerry Archibald <kerrya@element.io>

* fix remaining ts issues

Signed-off-by: Kerry Archibald <kerrya@element.io>

* tsconfig change

Signed-off-by: Kerry Archibald <kerrya@element.io>

* use sdkconfig patch instead of put

Signed-off-by: Kerry Archibald <kerrya@element.io>
2022-03-23 10:27:28 +00:00
Travis Ralston
d8a939df5d
Use & enforce snake_case naming convention on config.json settings (#8062)
* Document and support the established naming convention for config opts

This change:
* Rename `ConfigOptions` to `IConfigOptions` to match code convention/style, plus move it to a dedicated file
* Update comments and surrounding documentation
* Define every single documented option (from element-web's config.md)
* Enable a linter to enforce the convention
* Invent a translation layer for a different change to use
* No attempt to fix build errors from doing this (at this stage)

* Add demo of lint rule in action

* Fix all obvious instances of SdkConfig case conflicts

* Fix tests to use SdkConfig directly

* Add docs to make unset() calling safer

* Appease the linter

* Update documentation to match snake_case_config

* Fix more instances of square brackets off SdkConfig
2022-03-18 10:12:36 -06:00
J. Ryan Stinnett
6199c337ea
Fix spacing errors (#7484) 2022-01-10 12:57:20 +00:00
Aaron Raimist
7b94e13a84 Merge branch 'develop' into sort-imports
Signed-off-by: Aaron Raimist <aaron@raim.ist>
2021-12-09 08:34:20 +00:00
James Salter
43f264ccfc
Integrate analytics stubs (#7186)
* Add matrix-analytics-events as a dependency
* Make IEvent look like a stub definition
* Update pageview tracking to track screens, using a hypothetical definition of a screen event
* Remove distinction between pseudo and anon tracking, will need to rework it considering stubs
2021-12-06 21:43:42 +11:00
Aaron Raimist
bdc56be863
Auto fix
Signed-off-by: Aaron Raimist <aaron@raim.ist>
2021-10-22 17:23:37 -05:00
James Salter
839fdbca62 fix tests 2021-09-15 13:55:34 +01:00
James Salter
76c782c64c Remove all room data from tracking
Always redact room fragments entirely; remove room utils
2021-09-15 12:58:26 +01:00
James Salter
c2192a78bc More lint 2021-09-14 18:16:48 +01:00
James Salter
7344a177e3 Fix tests, swallow errors 2021-09-14 17:35:32 +01:00
James Salter
dc7aad1abf Revert "Revert "Add support for Posthog Analytics under a labs flag""
This reverts commit c5ea253181.
2021-08-03 11:55:02 +01:00
James Salter
c5ea253181
Revert "Add support for Posthog Analytics under a labs flag" 2021-08-03 07:30:02 +01:00
James Salter
ecbc536a3e Add copyright header 2021-07-28 14:15:27 +01:00
James Salter
a09e046c18
Update test/PosthogAnalytics-test.ts
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
2021-07-28 14:11:55 +01:00
James Salter
df7ebb2e7c Remove commented out block 2021-07-28 14:00:37 +01:00
James Salter
3ff7de3c96 Mock SHA-256 to avoid problems loading crypto on Node 14 2021-07-28 13:44:06 +01:00
James Salter
7cf28de9c9 take 2 at fixing import 2021-07-28 11:32:17 +01:00
James Salter
7c62386915 lint 2021-07-28 11:28:19 +01:00
James Salter
c697079eb4 Fix import 2021-07-28 11:22:40 +01:00
James Salter
a6df687196 Tidy up interface and add some comments 2021-07-28 09:54:37 +01:00
James Salter
1d81bdc6f9 Interface changes and anonymity fixes 2021-07-28 09:37:08 +01:00
James Salter
474561600e Fix hash == "" 2021-07-27 13:31:56 +01:00
James Salter
95f4275807 Add Disabled anonymity, improve tests 2021-07-23 16:47:02 +01:00
James Salter
6737cfd297 remove superflous dnt clear 2021-07-21 16:10:06 +01:00
James Salter
726b4497b2 Remove redactedCurrentLocation and rely on posthog for DNT
* Redact and pass the redacted url as a property. redactedCurrentLocation might have issues with concurrent events
* Remove DNT code and rely on posthog
2021-07-21 16:06:09 +01:00
James Salter
4c6b0d35ad Improve analytics interface
* Make it an error to call it before its initialised, and separately track whether its been enabled
* Use anonmity enum in the public interface
* Properly await upstream calls
* Fix accidental test fixture cross-reliance
2021-07-21 14:58:43 +01:00
James Salter
6da3cc8ca1 Redact sensitive data 2021-07-21 13:48:10 +01:00
James Salter
4b0cb409a0 Add identifyUser 2021-07-21 08:38:58 +01:00
James Salter
74b0e52f9a Enforce anon/pseudo-anon via types 2021-07-21 08:23:42 +01:00
James Salter
3135e42586 Add test for silently ignoring messages when not initialised 2021-07-21 07:42:55 +01:00
James Salter
2a48d3c9bc First pass at a PosthogAnalytics class 2021-07-21 07:40:39 +01:00