Commit Graph

402 Commits

Author SHA1 Message Date
Luna Mendes e7929b2099 schema.sql: fix table ordering 2018-11-13 04:34:26 -03:00
Luna Mendes cd08c657b1 .gitlab-ci.yml: use postgres hostname on psql 2018-11-13 04:28:50 -03:00
Luna Mendes 5aa1713133 .gitlab-ci.yml: add db initalization 2018-11-13 04:23:00 -03:00
Luna Mendes 797810df2c .gitlab-ci.yml: add git 2018-11-13 04:18:07 -03:00
Luna Mendes b58a0c5c84 .gitlab-ci.yml: add libffi-dev, openssl-dev 2018-11-13 04:14:15 -03:00
Luna Mendes c4b90d674a .gitlab-ci.yml: remove python3.7-dev 2018-11-13 04:09:44 -03:00
Luna Mendes cdad58bbc3 .gitlab-ci.yml: dunno maybe that works 2018-11-13 04:07:15 -03:00
Luna Mendes 893e96f8ec .gitlab-ci.yml: add cache related configs
taken from gitlab's default python ci config
2018-11-13 04:01:21 -03:00
Luna Mendes b9ccbbf53b Pipfile.lock: update it due to asyncpg update 2018-11-13 03:58:26 -03:00
Luna Mendes e7c51381e3 first try at a gitlab ci config
- Pipfile: update asyncpg from 0.16.0 to 0.18.2
2018-11-13 03:52:45 -03:00
Luna Mendes fb6a31a377 tests: add test_no_tracking.py 2018-11-13 02:53:53 -03:00
Luna Mendes e6c82cb3de remove utils/useradd.py
manage.py superseedes it.
2018-11-13 02:11:39 -03:00
Luna Mendes 46759a4e7c pylint pass
fixing unused imports across all code
2018-11-13 01:40:31 -03:00
Luna Mendes 40f7efd1df tests: add test_ratelimits, test_gateway
- tests: use event_loop fixture instead of get_event_loop
 - tests: move custom fixtures to conftest
2018-11-13 01:10:43 -03:00
Luna Mendes 77a72f6a1d manage.cmd: add users and tests subparsers
- litecord.auth: add hash_data, check_username_usage
 - litecord.auth: add create_user
 - tests: add credentials.py
2018-11-12 19:25:02 -03:00
Luna Mendes 8d64be1520 README: change tox from pipenv to global env
pipenv knows when its inside a virtual environment itself so we can pull
that trick off.
2018-11-12 18:15:04 -03:00
Luna Mendes 29b5f4cfb6 Pipfile: add pyflakes
- requirements: add pipenv so tox can use it when running
 - add setup.py
 - add tox.ini
2018-11-12 18:11:04 -03:00
Luna Mendes 1711192ac9 tests.test_main: fix testing 2018-11-12 17:39:30 -03:00
Luna Mendes 7bd8b456a2 Pipfile: lock quart to a commit
Quart 0.6.9 has issues with hypercorn due to it not implementing
ASGILifespan.

 - Pipfile: move pytest and pytest-asyncio to dev-packages
2018-11-12 16:44:29 -03:00
Luna Mendes 62332e15c3 run: add set_blueprints 2018-11-12 04:26:16 -03:00
Luna Mendes 7b75202311 tests: add basic test 2018-11-12 04:10:31 -03:00
Luna Mendes 599989f32e Pipfile: add pytest and pytest-asyncio 2018-11-12 02:50:14 -03:00
Luna Mendes 1b637ef3cc pubsub.lazy_guild: remove print and pprint calls 2018-11-12 02:08:48 -03:00
Luna Mendes fad8484a74 pubsub.lazy_guild: use SYNC instead of DELETE->INSERT->DELETE
This makes our implementation go off-spec (depends on what you'd even
call a spec, considering lazy guilds are not documented and probably
won't be), but well... *it works*

There are also a lot of print-debugs on this commit, will clean them up.

 - pubsub.lazy_guild: filter empty groups out of items list
 - pubsub.lazy_guild: check operator's op on Operation.to_dict
 - pubsub.lazy_guild: add resync() method to deal with re-SYNCs easily
 - pubsub.lazy_guild: fix get_item_index and get_group_item_index
 - pubsub.lazy_guild: drop the ops in complex presence updates in favour
    of using resync()
 - pubsub.lazy_guild: resync on group resorting
 - pubsub.lazy_guild: use resync() on role delete
2018-11-12 02:02:56 -03:00
Luna Mendes ea6e228bb4 pubsub.lazy_guild: use member ids instead of presences on main list 2018-11-11 00:14:59 -03:00
Luna Mendes 864f6a5d9f guild.members: add basic handling of nicks in lazy guilds
- pubsub.lazy_guilds: add a list lock to prevent inconsistencies
 - pubsub.lazy_guilds: add a lot of debug info related to list sorting
2018-11-09 19:02:26 -03:00
Luna Mendes f34c3f6296 pubsub.lazy_guilds: fix role_delete not finding group for role
- pubsub.lazy_guilds: add presence reassignment on role_delete
 - pubsub.lazy_guilds: fix getting role_range due to incorrect operators
2018-11-09 17:18:35 -03:00
Luna Mendes 58c818bb68 guild.members: call pres_dispatch on role updates
- presence: fix 'everyone' list detection
2018-11-09 16:38:19 -03:00
Luna Mendes 7103ac01ca pubsub.lazy_guild: sort groups in decreasing position order 2018-11-09 04:33:29 -03:00
Luna Mendes 04de62778c guild.roles: fix position of new roles
new roles will always have position 1
2018-11-09 04:32:19 -03:00
Luna Mendes ad0aa95f64 pubsub.lazy_guilds: add debug calls for role_pos_update 2018-11-09 04:11:52 -03:00
Luna Mendes 1d7a71a6ad pubsub.lazy_guild: bugfixes and better role_* methods
this fixes role_create and role_delete, adds more debug logging
to understand what is going on, etc.

 - pubsub.lazy_guild: promote role_update -> new_role when updating to
    hoist=True
 - pubsub.lazy_guild: promote role_update -> role_delete when updating
    to hoist=False
 - pubsub.lazy_guild: better handling of unknown group items on
    role_delete
2018-11-09 03:56:00 -03:00
Luna Mendes 5fa5aac2f5 pubsub.lazy_guild: bugfixes, take 2 2018-11-09 03:12:48 -03:00
Luna Mendes 17dfeb0f11 pubsub.lazy_guild: bugfixes 2018-11-09 03:09:55 -03:00
Luna Mendes e0011d7a38 pubsub.lazy_guild: add implementation for role_update 2018-11-09 01:47:49 -03:00
Luna Mendes 950b9b83b2 pubsub.lazy_guild: add implementations for new_role and role_pos_update 2018-11-09 01:19:49 -03:00
Luna Mendes 6c63e014ae blueprints.guild.roles: add basic comms between roles bp and lazy guilds
- pubsub.lazy_guild: add LazyGuildDispatcher.dispatch
 - pubsub.lazy_guild: add GuildMemberList.role_delete
2018-11-09 00:47:22 -03:00
Luna Mendes 6245f08289 Merge branch 'lazy-guilds' into 'master'
Lazy guilds

Closes #12, #9, #8, and #2

See merge request luna/litecord!2
2018-11-08 02:12:45 +00:00
Luna Mendes 748eacf112 pubsub.lazy_guild: fix bugs around p_idx calculation 2018-11-07 23:03:48 -03:00
Luna Mendes 3b532fa8b0 blueprints.users: fix settings being updated for everyone 2018-11-07 22:52:26 -03:00
Luna Mendes 134cc0eec8 pubsub.lazy_guild: add draft impl for complex updates 2018-11-07 22:51:16 -03:00
Luna Mendes 8b093d3d16 pubsub.lazy_guild: better algorithm for presence updates
this gives the separation between "complex" and "simple"
presence updates we can generalize on.
2018-11-07 21:07:31 -03:00
Luna Mendes 7be9d30f5d cmd.migration: add debug log 2018-11-07 19:16:44 -03:00
Luna Mendes a394c02477 schemas: add USER_SETTINGS.status 2018-11-07 19:15:07 -03:00
Luna Mendes e1a946eb87 pubsub.lazy_guild: use filter instead of genexpr 2018-11-07 19:10:27 -03:00
Luna Mendes 773ab8fd18 pubsub.lazy_guild: fix fetching user id from item
- pubsub.lazy_guild: fix get_state on unknown session id
2018-11-07 19:08:31 -03:00
Luna Mendes bd9c4cb26c pubsub.lazy_guild: add implementation for pres_update
- utils: fix index_by_func
2018-11-07 18:52:50 -03:00
Luna Mendes c212cbd392 pubsub.lazy_guild: change some instance vars to properties
- utils: add index_by_func
2018-11-07 17:53:31 -03:00
Luna Mendes 7bcd08ef7a pubsub.lazy_guild: remove LazyGuildDispatcher.unsub
states subscribe via shard_query only.
2018-11-07 17:13:30 -03:00
Luna Mendes 3b2f6062fc pubsub.lazy_guild: subscribe user to the given range 2018-11-07 16:41:22 -03:00