Commit Graph

1554 Commits

Author SHA1 Message Date
Ske
6538c5d054 Fix line endings in WebhookCacheService 2019-10-27 13:09:07 +01:00
Ske
aed38f37f7 Allow starting bot before all shards are up 2019-10-27 13:01:33 +01:00
Astrid
eb62602fbb
Run GH Actions check on PR 2019-10-27 12:35:13 +01:00
Noko
dd37c8a6d6 Fix bulk importer parameter and remove unused method (#136)
-Fixes AddSwitchesBulk post-refactor by passing in the switch timestamp instead of a set of PKMembers
-Removes unused RegisterSwitches method which was replaced by AddSwitchesBulk
2019-10-27 11:37:16 +01:00
Ske
bb939697d8 Add myself to FUNDING.yml 2019-10-26 19:47:58 +02:00
Ske
295f9f8abc Remove deprecated Web solution 2019-10-26 19:47:11 +02:00
Ske
6a73b3bdd6 Refactor data stores, merging the Store classes 2019-10-26 19:45:44 +02:00
Astrid
1ab84b54dd
Update dotnetcore.yml 2019-10-26 15:18:42 +02:00
Astrid
029eed3786
Merge pull request #134 from nephanim/feature/member-limit
Add members per system cap & improve import performance
2019-10-22 19:33:30 +02:00
Ske
53ae0e3d70 Improve error handling and reporting after command rewrite 2019-10-22 19:31:40 +02:00
Noko
593e9d9aef Fix edge case of importing exactly enough members to hit the cap
It's OK if import will bring us to the cap (1000), just don't let the count go beyond that.
2019-10-20 18:24:00 -05:00
Noko
406f005b4f Bulk import switches for pk;import
We're now using binary import for switches and switch_members when importing a system profile, rather than importing them one switch at a time.

This adds a pass-through method to the PerformanceTrackingConnection that can be used for other bulk import applications.
2019-10-20 14:38:43 -05:00
Noko
3d21adeec9 Fix reversal of import response messages
Some of the command rewrite changes resulted in the response messages for importing a system being swapped. When importing without an existing system (ctx.System == null), we want to display the "new system" message. Otherwise, show the count added/modified.
2019-10-20 02:22:22 -05:00
Noko
397da2e1fa Added max member count to limits
A given system can now have up to 1000 members. Within 50 members of that limit, a warning will display whenever a new member is created via the bot. Once the limit is reached, a final warning will appear indicating that no additional members can be created unless members are first deleted. Attempting to create a new member at that point by any method will result in an error message indicating that the limit has been reached.

Respecting this in pk;import required some restructuring to tease apart which members already exist and which ones need to be created prior to creating any members as it seems preferable to fail early and give the user the ability to intervene rather than pushing the system to the member cap and requiring manual deletion of "lower priority" members before others can be created. One consequence of the restructure is that existing members are being read in bulk which is a performance improvement of 25-70% depending on how many switches need to be imported (the more members you have, the more noticeable this is).
2019-10-20 02:16:57 -05:00
Noko
a277f4fb87
Merge pull request #2 from xSke/master
Merge head repository with base
2019-10-19 19:05:39 -05:00
Ske
284e8eb95a Include underscore properly in display_name API docs 2019-10-18 13:38:25 +02:00
Astrid
6db4106519
Merge pull request #121 from greysdawn/patch-2
Edit API to include member display names
2019-10-18 13:37:16 +02:00
Astrid
af4da8fd72
Merge branch 'master' into patch-2 2019-10-18 13:37:09 +02:00
Ske
4ce4efcc61 Fix importing brackets from Tupperbox. Closes #123 2019-10-18 13:34:54 +02:00
Ske
c4d28f64c7 Display system/member created date in embed footer.
Closes #122.
2019-10-18 13:29:16 +02:00
Astrid
1d7a4d78db
Merge pull request #126 from xBelladonna/feature/messagecard-nickname
Display guild user nickname on message card if set
2019-10-18 13:22:48 +02:00
Astrid
bf13c55266
Merge pull request #133 from nephanim/perf/export
Improve export performance
2019-10-18 13:22:33 +02:00
Astrid
e91ecebb39
Merge branch 'master' into perf/export 2019-10-18 13:21:19 +02:00
Astrid
49adcd680a
Merge pull request #132 from nephanim/perf/frontpercent
Improve frontpercent performance
2019-10-18 13:20:43 +02:00
Astrid
bca296533b
Merge pull request #130 from nephanim/feature/import-switches
Export/import displaynames and switches
2019-10-18 13:20:34 +02:00
Ske
49dede7ff8 Remove compiler warning from API 2019-10-18 13:19:17 +02:00
Ske
83c709b69d Sanitize more inputs 2019-10-18 13:14:36 +02:00
Noko
adea7be07c Improve export performance
Refactored ExportSystem to:
- Only fetch message counts once (instead of a query per member)
- Fetch switches using the newly refactored GetTruncatedSwitchList (gets switches and their members in one shot instead of querying for switch members one switch at a time)

- Added a new MessageCountsPerMember method to MemberStore to support the above
- Modified GetTruncatedSwitchList query to retrieve switches with no members (wasn't important for frontpercent, but is if we're reusing that method here)

This doesn't require any index changes beyond those that support GetTruncatedSwitchList, though we can see a small benefit with an index on messages covering the member column (valuable for other reasons outside of these additions).
2019-10-06 02:03:28 -05:00
Noko
ef7b825aa6
Merge pull request #1 from nephanim/feature/import-switches
Bring performance branch in line with export/import changes
2019-10-05 22:51:11 -05:00
Noko
bc0213c9a1 Added indexes to support frontpercent query changes
Note: need to determine conventions to use for index names and settings going forward. There are also some indexes in production that aren't in here and are probably good additions to a standard set.
2019-10-05 15:30:55 -05:00
Noko
845ec90c3e Improve frontpercent performance
Refactored GetTruncatedSwitchList to:
- Only fetch switches in the requested range
- Fetch switch members in bulk rather than one switch at a time

This uses a new GetSwitchMembersList method that requires the following indexes:

CREATE INDEX ix_switches_system
ON public.switches USING btree
(system ASC NULLS LAST)
INCLUDE("timestamp")
TABLESPACE pg_default;

CREATE INDEX ix_switch_members_switch
ON public.switch_members USING btree
(switch ASC NULLS LAST)
INCLUDE(member)
TABLESPACE pg_default;
2019-10-05 15:08:27 -05:00
Ske
1988b29fbc Refactor command system 2019-10-05 07:41:00 +02:00
Noko
7406f18bf5 Import switches
- ImportSystem builds a mapping of data file HID to current system HID
- Switches in a data file are reconciled with system members' actual IDs using this mapping
- SwitchStore provides a RegisterSwitches method to register multiple switches
- RegisterSwitches only imports a switch if one does not exist with the same timestamp
- The number of switches created is logged
2019-09-29 14:40:13 -05:00
Noko
633c181e84 Add displayname to PK export/import
- Add display_name property to member on PK export
- Set display_name if provided when importing from PK export file
2019-09-28 23:29:32 -05:00
xBelladonna
658bcf1faf Display guild user nickname on message card if set 2019-09-22 02:04:20 +09:30
Ske
0ec522ca0a Display member roles in message query card 2019-09-21 15:19:38 +02:00
Ske
86d0b24758 Include event ID in Sentry dump 2019-09-02 20:37:24 +02:00
Ske
7d1accd58d Fix file name of tips and tricks page 2019-08-31 19:13:37 +02:00
Ske
1bfdb43c1f Fix message model table 2019-08-31 19:13:10 +02:00
Ske
cfd8a2cfdb Fix README formatting 2019-08-31 19:12:48 +02:00
Ske
dbade9b6bc Various minor site/documentation changes 2019-08-31 12:32:28 +02:00
Grey Himmel
ad6624ce02
Order members regardless of name case
Add `toLower()` method to the sorting used in system lists, so members are ordered regardless of if the first letter of their name is upper or lowercase
2019-08-25 20:25:37 -04:00
Ske
9b0b8b4353 Fix Clyde, also without an attachment 2019-08-14 07:21:03 +02:00
Ske
74e0508065 Increase webhook name limit to 80 2019-08-14 07:16:48 +02:00
Ske
5ef8a9303d Update .gitignore 2019-08-13 23:28:24 +02:00
Ske
ec49d10d66 Add .editorconfig 2019-08-13 23:28:03 +02:00
Ske
4e69531103 Ignore invalid colors in member card 2019-08-13 21:49:43 +02:00
Ske
4d2c843442 Handle busy indicator without permission properly 2019-08-12 18:07:29 +02:00
Ske
fb7f31d42d Invalidate proxy caches on more editing commands 2019-08-12 17:49:07 +02:00
Ske
d8503001eb Show an error when a bad import URL is given 2019-08-12 17:47:35 +02:00