1
1
Fork 0
mirror of https://code.mensbeam.com/MensBeam/Arsse.git synced 2024-12-23 17:12:41 +00:00
Commit graph

516 commits

Author SHA1 Message Date
J. King
054200dfc0 Fix potential of erroneous matching of URL containing encoded #. 2017-05-20 08:57:24 -04:00
J. King
0972cff660 Completely revamped NCNv1 REST handler
- URLs are now matched centrally against a whitelist
- %-encoded URLs are still handled correctly
- Dispatched methods now only handle one specific task
- Filler methods (e.g. versionPOST) are no longer required
- Unhandled URLs now return 501 Not Implemented rather than 404 Not Found; this removes some ambiguity in the semantics of 404
2017-05-19 23:52:26 -04:00
J. King
4a816f827b NCNv1 feed calls and other changes
- Implemented all but one feed-related function (it's more ofan item function)
- Fixed time conversion for input into SQL; dates in PM were previously wrong
- Added miscellaneous tentative functions to Database to help with peculiarities of NCNv1; these may change
- Tests to come soon
2017-05-18 23:03:33 -04:00
J. King
0bc2841837 Last of subscription tests
- Also tweaked SQL dateformat() function to output proper HTTP dates
- Also introduced method to set a default output date format
2017-05-18 13:21:17 -04:00
J. King
99ae274ef8 Also test negative read marks 2017-05-16 22:24:36 -04:00
J. King
ef3cb4fa54 Test unread counts in subscriptionList 2017-05-16 22:19:40 -04:00
J. King
f635155687 Basic tests for subscription list
- Need entries and read marks to fully test
- Added assertion type to test result subsets
- Fixed custom subscription titles
2017-05-14 23:03:48 -04:00
J. King
acbb254bfb Tests for removing subscriptions 2017-05-11 23:20:10 -04:00
J. King
98c950de58 Removed most calls to userExists()
- functions not related to user management now have the existence of the affected user checked in the authorizer, when the affected user differs from the actor
- User::authorizationEnabled() now nests: disabling twice and then enabling once leaves the authorizer disabled
- Disabling of the authorizer is now tested
- User tests now use a partial mock instead of relying on User::authorizationEnabled()
- Added authorizer tests against a missing user
- Removed folder tests related to missing users
- Also added more subscription tests
2017-05-11 18:00:35 -04:00
J. King
a580579627 First set of Database subscription tests 2017-05-10 22:01:00 -04:00
J. King
554beacfdb Improved database tests
- Centralized initial state; this will be useful due to foreign key interdependence
- Added nextID() method to make insert tests less brittle
2017-05-10 21:21:23 -04:00
J. King
8ebcb01cb5 Made out-of-order transaction handling more predictable 2017-05-07 18:27:16 -04:00
J. King
2083c6e397 Change transactions to auto-rollback on exceptions 2017-05-06 12:02:27 -04:00
J. King
c2a7ad7b19 Optimize initial feed update 2017-05-04 22:43:18 -04:00
J. King
fb922e65e4 Tests for strict binding 2017-05-04 19:38:54 -04:00
J. King
db132c0c24 Various changes to Database
- Introduced "strict" binding types for use when inserting into NOT NULL columns: any null value supplied is always cast to the supplied type rather than passing through
- Fixed feed updating further
- Filled out full complement of subscription manipulation functions
- made folderPropertiesSet possibly return false
2017-05-04 19:12:33 -04:00
J. King
9c7f4710aa Fix feed fetching
There are almost certainly other bugs; proper tests forthcoming
2017-05-04 14:42:40 -04:00
J. King
9dccdb32a7 Fold feedAdd into subscriptionAdd
A feed will enver been added independently of a subscription
2017-05-04 11:13:24 -04:00
J. King
717e74fb2e Refactored special case for testing 2017-05-03 20:00:29 -04:00
J. King
8376cc9cb9 Mark articles as unread when they are updated 2017-05-01 18:29:07 -04:00
J. King
7546e3b11b Add the ability to throw exceptions in a feed update if desired
This is useful when adding a new feed
2017-04-30 18:36:31 -04:00
J. King
43f73b5d71 Make better use of prepared statements when updating feeds 2017-04-30 18:14:11 -04:00
J. King
3bc9082cfa Integrated adaptive update intervals Fixes #51 2017-04-30 17:54:29 -04:00
J. King
3b4d79abc8 Implement second part of adaptive update interval; improves #51
Implements part of algorithm used when feed has been updated
2017-04-27 09:47:40 -04:00
J. King
2e64e60f2e Implement part of adaptive update interval; improves #51
Implements part of algorithm used when a feed has not been updated; this is much simpler than when a feed has been modified
2017-04-24 21:51:56 -04:00
J. King
f842439b01 Deduplicate feed items within the feed itself 2017-04-23 13:12:33 -04:00
J. King
93c010d3d5 Move feed item change detection to Feed class 2017-04-22 23:40:57 -04:00
J. King
b1b96bb806 Completed refactoring of feed updates
- In-feed deduplication still to do
- Content scraping still to do
- Lots and lots of testing still required
2017-04-20 21:59:12 -04:00
J. King
119d42907e More feed update refactoring
Still very much incomplete: in its present form it would yield many false duplicates
2017-04-15 22:07:22 -04:00
J. King
4e57e56ca7 Start on refactoring of feed processing 2017-04-13 22:17:53 -04:00
J. King
557d17ef5d Add rollbacks in error cases 2017-04-09 18:15:00 -04:00
J. King
a67fe30408 Fix whitespace
Also fixed my editor so tabs won't happen again!
2017-04-06 21:41:21 -04:00
J. King
b02abec250 Added test for recursive binding
Also fixed a bug uncovered by the test
2017-04-06 21:24:26 -04:00
J. King
818707b067 Fix adding a subscription (again)
Also ensured HTTP last modified date is parsed properly.
2017-04-06 20:50:47 -04:00
J. King
e6f2f22888 use list() instead of extract()
Improves clarity where Database::generateSet() is actually used at the expense of clarity within the method itself
2017-04-06 13:29:39 -04:00
J. King
929d763981 Simplify the creation of arbitrary UPDATEs
The type parameters of Db\Driver::prepare() and the parameters of Db\Statement::run() can now be arrays, which will be iterated over recursively to bind scalar values to the SQL statement.

This simplifies the construction of arbitrary UPDATE statements (the WHERE clause no longer needs to be taken into account) and should make it clearer what is happening in these cases.

It should also simplify the creation of IN() clauses down the road if they become necessary.
2017-04-06 11:02:47 -04:00
Dustin Wilson
25aeaf4801 Grab favicon from site's URL, not the feed's
• Changed Feed to where the favicon is gotten when parsing so the
feed’s site URL is used instead of the feed’s for favicons. Some feeds
don’t have the same domain.
• Fixed a bug in Database.
2017-04-02 21:23:15 -05:00
J. King
74ae1106a4 Implement NCN API v1-2 server version reporting
- Fixes #29
- Yes, it's trivial, but now it's done!
2017-04-02 21:49:37 -04:00
J. King
9cbfa378bc Implement NCN API v1-2 folder deleting/renaming
- Fixes #5
- Fixes #6
- Rewrote the NCNv1 dispatcher to better handle URL edge cases
2017-04-02 21:34:30 -04:00
J. King
19abce85c3 Implement NCN API v1-2 folder creation
- Fixes #4
- Tests for failure modes still required
2017-04-02 12:14:15 -04:00
J. King
842e277d43 Implemented NCN API v1-2 folder list
- Fixes #2
- Also re-organized REST handling
2017-04-01 23:06:52 -04:00
J. King
dc9f5e545e Fix adding a feed
Also start on handling the v1-2 API
2017-04-01 15:42:10 -04:00
J. King
718c5a04dd Add authz verification to folder tests 2017-04-01 15:06:34 -04:00
J. King
1e1b848c62 Remove root field from folders table
The field is no longer required with the use of recursive common table expressions, and  presents a possible loss of referential integrity
2017-04-01 14:49:31 -04:00
J. King
a111bcc231 Folder get/set prop funcs and other changes
- Simplified folder removal; now properly relies on foreign keys for dependency resolution
- simplified *propertiesSet() methods by offloading input validation and query building to a generic function
- Implemented function to get the properties of a single folder (useful for internal use)
- Implemented a function to set the properties of a folder
2017-04-01 10:27:26 -04:00
J. King
2344911f78 Tests for removing folders 2017-03-31 18:48:24 -04:00
J. King
458eaac5c6 Tests for listing folders
- Fixed checking for existence of parent before listing
- Changed Result->getAll() to return an empty array rather than null for an empty result set
2017-03-31 17:42:28 -04:00
J. King
b68cea1188 Tests for adding folders 2017-03-31 15:27:59 -04:00
J. King
82e4838162 Re-organize Database tests
- Test files now consist entirely of traits:
 - General setup trait mocking User class and cleaning up
 - Driver trait to set up the database connection
 - Series trait containing tests for the series, independent of driver used
2017-03-31 13:24:00 -04:00
Dustin Wilson
bc863ae935 Updated Database->updateFeeds()
• Added category updating in Database->updateFeeds()
• Made Database->updateFeeds() fail quietly when exceptions are
occurred, logging them in the database instead of failing.
• Changed the categories table name from arsse_tags to arsse_categories.
2017-03-30 09:42:37 -05:00