Commit Graph

12 Commits

Author SHA1 Message Date
realaravinth
4cd4605266 chore: use local app ctx 2022-05-27 15:25:10 +05:30
realaravinth
2dd18897b0 feat: migrate getting traffic pattern to use db_* interface 2022-05-14 18:45:59 +05:30
realaravinth
a6920f5f36 feat: migrate add user's traffic pattern sqlx postgres to use db_* 2022-05-14 18:22:50 +05:30
realaravinth
a971d4209d fix and chore: refactor tests to minimize initializing DB connections
SUMMARY
    The test suite was spinning up way too many database connections that what's
    strictly needed and so the test suite was failing with[0]:
	code: "53300", message: "sorry, too many clients already"

EXPERIMENTS
    Tried sharing database connection pool across all tests with
    async_once[0] but faced:
	- IO errors
	    The connections were probably getting dropped in between tests
	- actix Actor errors
	    The actor was probably not getting initialized before a
	    a reference to the async_once initialized app
	    context(crate::data::Data) is retrieved and used

FIX
    crate::tests was spinning up an App context
    instance(crate::data::Data) for most utility functions, which was
    unnecessarily excessive.

    Each test now creates an instance of the application context at the
    beginning and shared a reference with all test utility functions. So
    number of database connections/app context instance = number of unit
    tests.

[0]: permanently fixes #22
[1]: https://docs.rs/async_once/latest/async_once/
2022-05-14 12:55:56 +05:30
realaravinth
b057e48d72 feat: migrate pages mod to use actix_auth_middleware 2022-05-07 12:29:02 +05:30
realaravinth
fc8a1670d2 update copyright notice 2022-01-08 22:16:05 +05:30
realaravinth
c46b3f4f4c Implement easy edit view
When user tries to visit this view without an easy configuration
available, i.e, user had created the CAPTCHA using advance view and no
TrafficPattern is available in database, the user will be automatically
redirected to the advance edit page.

But the default edit link everywhere is to the easy edit view.
2021-12-18 21:01:19 +05:30
realaravinth
784aa26dbb mv edit sitekey into advance edit sitekey 2021-12-18 18:19:23 +05:30
realaravinth
fa9762200e mv sitekey edit to easy edit 2021-12-18 16:41:00 +05:30
realaravinth
1d759fcb25 captcha stats 2021-07-27 15:28:21 +05:30
realaravinth
102ef5b4a1 edit sitekey button in sitekey list table 2021-07-16 17:50:38 +05:30
realaravinth
ea8264054a edit sitekey, router pattern matching, sitekey update optimization, rm level delete and level err handling 2021-07-16 17:40:52 +05:30