1006 Commits

Author SHA1 Message Date
FoxxMD
3292d011fa Merge branch 'edge' 0.11.3 2022-06-21 10:03:14 -04:00
FoxxMD
d7cab4092d fix(ui): Hide save reason input when user cannot save 2022-06-16 14:25:06 -04:00
FoxxMD
0370e592f9 feat(ui): Add text input to specify reason for wiki edit on config page 2022-06-16 09:43:27 -04:00
FoxxMD
116d06733a fix(ui): Stop trying live stats if an error is encountered 2022-06-14 22:33:12 -04:00
FoxxMD
22a8a694a7 fix(modnote): Fix initial implementation bugs
* Improve action criteria to FullCriteria function
  * Don't include undefined properties
  * Iterate entries with switch to simplify property transformations
* Fix mod action test switch case matching to be case-insensitive (same as key)
* Fix missing/bad assignments for filtering mod actions
* Fix typo usage of foundNoteResult in modActions case block
* Throw error if mod action criteria isn't recognized as note/log instead of silently falling back to log
2022-06-14 12:55:35 -04:00
FoxxMD
2ed24eee11 fix(logging): Fix missing modAction property transformation for filter summary 2022-06-14 12:51:47 -04:00
FoxxMD
8822d8520a fix(check): Fix check data used to determine trigger text hint 2022-06-14 12:51:02 -04:00
FoxxMD
9832292a5b docs(mod actions): Add docs for mod log/note actions and filtering 2022-06-13 15:19:34 -04:00
FoxxMD
7a86c722fa feat(author criteria): Add temporal filtering to usernotes and mod notes 2022-06-13 13:42:57 -04:00
FoxxMD
2ca4043c02 chore(organization): Move comparison and comparison parsing functions into Comparisons file 2022-06-13 12:13:20 -04:00
FoxxMD
4da8a0b353 feat(author criteria): Refactor criteria test order to optimize api usage #92
* Test props in order of least likely to use an API call
  * Enables simplifying shadowbanned test and allows testing for more properties on shadowbanned user
2022-06-13 11:50:12 -04:00
FoxxMD
492ff78b13 chore(modnotes): Cleanup interfaces and add missing activityType to modnote criteria 2022-06-10 13:34:04 -04:00
FoxxMD
64a0b0890d feat: Improve/fix bot addition
* Fix existing bot removal
* Return response to client after testing client rather than after managers build to avoid long response time if bot has many subreddits
2022-06-10 12:31:56 -04:00
FoxxMD
546daddd49 feat(config): granularly merge bot data into yaml operator config 2022-06-10 12:15:46 -04:00
FoxxMD
f91d81029f feat(modnote): Implement modnotes as part of author criteria 2022-06-09 15:28:29 -04:00
FoxxMD
68ee1718e0 feat(modnote): Prevent getting modnotes for subreddit not currently moderated 2022-06-09 12:58:29 -04:00
FoxxMD
c0d19ede39 feat(modnote): Improve handling of modnote data and implement caching
* Normalize (depopulate from snoowrap) mod note raw data so it can be constructed agnostic of source (cache or api)
* Implement cache GET for modnotes with default TTL of 60 seconds
* Refactor mod note action and implement cache PUT when new notes are added
2022-06-09 12:54:23 -04:00
FoxxMD
bb05d64428 feat: Improve reddit entity type guards
* Use 'in' operator to avoid triggering snoowrap proxy
* Add subreddit type guard
* Fix missing undefined check for names
2022-06-09 12:17:51 -04:00
FoxxMD
1977c7317f fix(modnote): Fix modnote mapping from created response 2022-06-07 14:36:36 -04:00
FoxxMD
6f784d5aa2 feat(modnote): Implement fetching modnotes and refactor to get in sync with edge 2022-06-07 14:29:33 -04:00
FoxxMD
4b5c9b82e4 Merge branch 'edge' into modnote
# Conflicts:
#	src/Action/ActionFactory.ts
#	src/Action/index.ts
#	src/Common/types.ts
#	src/Schema/Action.json
#	src/Schema/App.json
#	src/util.ts
2022-06-07 12:52:58 -04:00
FoxxMD
0315ad23ae feat(ui): Prevent indexing by robots 2022-06-02 13:45:39 -04:00
FoxxMD
da70753f42 feat(database): Add missing indexes to improve event retrieval performance
I was under the impression primary keys were always indexed but that is not the case, at least for postgres. This migration explicitly creates uniques indexes for all tables that use random ids and adds other indexes to filter/premise/result tables on other FK strings. Improves event retrieval timing dramatically.
2022-05-26 14:36:15 -04:00
FoxxMD
661a0ae440 Merge branch 'edge' 0.11.2 2022-05-26 09:59:32 -04:00
FoxxMD
d59f1b63d1 chore: Bump version 2022-05-26 09:59:17 -04:00
FoxxMD
7542947029 feat(sentiment): More improvements to sentiment and language processing
* Implement separate language detection functionality
* Clearer/simpler sentiment processing
* Add languageHints to help coerce low confidence language detection
* Add test cases for lang detection, sentiment detection, and sentiment tests
* Fix neutral range -- was not using normalized score range
2022-05-25 12:59:37 -04:00
FoxxMD
2d02434e7e feat(sentiment): Better use of NLPjs and more robust language detection
* Build NLP container ad-hoc so only supported languages are included from npm
* Use vader/wink as heuristics for detecting language when content is very short
* Add languageHint option for sentiment config to make coercing a confident sentiment easier
* Refactor lang processing to fail the sentiment test rather than throwing an error when language is not support/not confident -- provides more insight into outcome
2022-05-24 16:34:37 -04:00
FoxxMD
e2824ea94c chore(docker): Remove superfluous dev packages from final docker layer #88
typeorm depends on ts-node as an *optional peer* dependency -- ts-node can be used in the typeorm cli to parse entities and run migrations.

However CM doesn't use typeorm CLI for running production so its not needed. And ts-node depends on typescript so npm install --production always installs both at about ~30MB.

I couldn't find a good way to remove peer deps ONLY for typeorm so instead just manually remove the folders from the prod install in the final layer of the docker.
2022-05-24 10:31:15 -04:00
FoxxMD
1c94548947 chore: Update TS version and move into dev dependencies
Not needed to actually run the app after it has been built so moving to dev-dependencies
2022-05-24 10:26:46 -04:00
FoxxMD
2073e3f650 chore: Update dependencies 2022-05-24 09:37:59 -04:00
FoxxMD
90b8f481ec chore: Remove unused dependencies #88 2022-05-24 09:33:29 -04:00
FoxxMD
9ad9092e9e feat(dispatch): Fix regression introduced when removing processing state from dispatch action lifecycle
Should have removed entire check for processing but only removed part of if condition, resulting in matched activities never being returned
2022-05-23 14:23:16 -04:00
FoxxMD
12adfe9975 fix(approve): Improve activity type detection and add more result output 2022-05-23 14:22:01 -04:00
FoxxMD
83dceddae8 feat(ui): Simplify live stats by moving into browser logic
* Refactor to use interval in browser to call to api proxy endpoint and get live stats directly instead of using websockets. Generally simplifies things.
* Remove empty/superfluous data from cache stats returned for live data
2022-05-23 14:13:28 -04:00
FoxxMD
99b46cb97f fix(polling): Improve logic for returning only 'new' Activities from polling sources
Prevents CM from iterating through n+1 pages of polling sources (mostly unmoderated) due to a source-of-truth change

See comments for scenario this helps avoid
2022-05-23 12:35:42 -04:00
FoxxMD
3ac07cb3e2 fix(cache): Fix cache init bug caused by passing additional (unnecessary) args 2022-05-23 11:12:51 -04:00
FoxxMD
d7f08d4e27 chore: Remove superagent browser dep 2022-05-19 15:49:32 -04:00
FoxxMD
338f393969 feat(logging): Simplify log streaming logic #91
* Get streamed logs directly from api (through proxy) in browser using streaming apis instead of through client websockets
* Use observer visibility to determine which logs to stream
* Timeout and abort any streaming logs if tab hasn't been visible for more than 15 seconds

TODO streaming system logs
2022-05-19 15:21:41 -04:00
FoxxMD
57e930ca8a feat(logging): Only load logs for initially viewed manager #91
* Don't include any logs in 'status' page response data
* Make log api call from browser to retrieve initial logs based on observer
2022-05-19 13:07:18 -04:00
FoxxMD
af3b917b57 feat(logging): Move log formatting for ui into client #91
* Use browserify to include logform functions and triple-beam symbols in client js
* Implement default log transform function in client js
* Remove formatted message and transport data from non-streaming log data sent to client
2022-05-19 12:11:33 -04:00
FoxxMD
d01bcc53fe fix(resource): Fix throwing the wrong type of error 2022-05-17 15:07:49 -04:00
FoxxMD
e2fe2b4745 feat(resources): Add more try-catch blocks for activity caching to make error tracing easier and reduce change of unhandled promise rejection 2022-05-17 15:01:18 -04:00
FoxxMD
785099b20c fix(database): Add missing managerId to premise entities?
Thought this was added automatically by typeorm by a user's logs seem to think otherwise
2022-05-17 15:00:39 -04:00
FoxxMD
726ceb03d2 fix(delay): Improve delayed activities interaction in manager and fix usage in resources
* Fix missing assignment for filtered activities after removing activity
* Remove 'processing' state from delayed activity lifecycle
  * Allows delayed queue to immediately remove activity after pushing to firehose -- simplifies lifecycle since another function (queue) doesn't have to handle this
    * Removing delayed activity function call from queue logic reduces calls to database
  * Likelihood an activity is cancelled while also processing is small (i hope...)
* Re-order item refresh logic in activity handling so delayed items are fetched before any proxy properties are accessed
* Catch errors on adding delayed activities from DB and just log -- not essential function
2022-05-17 14:18:55 -04:00
FoxxMD
1c37771591 chore: Update version constant 2022-05-17 14:12:17 -04:00
FoxxMD
67aeaea5f1 chore(dispatch): Add id manually to activity proxy when hydrated from database 2022-05-17 13:34:36 -04:00
FoxxMD
a8ac4b8497 fix(manager): Change activity property used to track queue meta
Use 'name' since this should *always* be present on a submission/comment -- when snoowrap creates an empty proxy it only includes 'name'.

* Potentially fixes facet of #64
* Fixes shouldRefresh undefined when activity is from delayed activities in database (empty proxy)
2022-05-17 13:33:37 -04:00
FoxxMD
71571d3672 fix(delay): Reduce delayed activities lifecycle complexity
* Refactor from async while depending on queue state into interval that always runs and just checks paused status of queue -- eliminates need to restart while loop if queue state is not running
* Add canary debug output for delayed activities to be able to know if it is actually running
2022-05-17 12:56:29 -04:00
FoxxMD
2799b6caeb fix(delay): Clean up dispatched action fields and parsing in ui
* Use duration field as SECONDS and remove additional time-based field (not necessary)
* Refactor dayjs usage in UI to parse action delay duration and correctly display "time until dispatch" to show if duration is negative
2022-05-17 12:10:23 -04:00
FoxxMD
e8f94ad1be Merge branch 'sentimentRule' into edge 2022-05-13 10:41:40 -04:00