David ‘Bombe’ Roden [Tue, 6 Dec 2022 21:40:01 +0000 (22:40 +0100)]
🚧 Add no-negative identity filter
This mirrors exactly what the IdentityManager already does but it adds a test!
David ‘Bombe’ Roden [Tue, 6 Dec 2022 21:36:04 +0000 (22:36 +0100)]
🎨 Add methods to create explicit and implicit trust values
David ‘Bombe’ Roden [Tue, 6 Dec 2022 21:30:24 +0000 (22:30 +0100)]
🎨 Add empty set as default for contexts
David ‘Bombe’ Roden [Mon, 12 Sep 2022 18:55:28 +0000 (20:55 +0200)]
🚧 Don’t cancel on archive manifests
David ‘Bombe’ Roden [Sun, 11 Sep 2022 11:32:58 +0000 (13:32 +0200)]
🚸 Download the files, including from archives
David ‘Bombe’ Roden [Fri, 2 Sep 2022 15:56:58 +0000 (17:56 +0200)]
🔊 Log element loader’s decisions and results
This should make it way easier to find out why a certain element wasn’t loaded.
David ‘Bombe’ Roden [Fri, 2 Sep 2022 15:27:11 +0000 (17:27 +0200)]
🚸 Improve text extraction even further
This actually revamps the way the first paragraph is extracted from freesites and could cause a lot more descriptions to show up in Sone — which was the goal!
Previously I tried to locate all top-level nodes (under <body>) that themselves had text nodes below them and whose name did not start with an “h” (to exclude the header tags) but it turns out this can be easily defeated by wrapping all of the site in e.g. a <center> tag. And I’m sure that a <div> tag would do exactly the same…
So now I use a CSS selector query to get all <p> and <div> nodes, get those with text nodes below them and then get their text (which flattens them for me and removes embedded tags like <a> or <span>).
David ‘Bombe’ Roden [Fri, 2 Sep 2022 15:18:21 +0000 (17:18 +0200)]
🚸 Improve text extraction from freesites
David ‘Bombe’ Roden [Fri, 2 Sep 2022 15:14:06 +0000 (17:14 +0200)]
♻️ Add matcher for linked elements
David ‘Bombe’ Roden [Fri, 2 Sep 2022 14:42:41 +0000 (16:42 +0200)]
♻️ Move extension methods out of classes
David ‘Bombe’ Roden [Fri, 26 Aug 2022 11:10:25 +0000 (13:10 +0200)]
✅ Rewrite test to not use Mockito
David ‘Bombe’ Roden [Fri, 26 Aug 2022 10:15:00 +0000 (12:15 +0200)]
🎨 Reduce dependency on Node’s fields
Using fields is getting increasingly hard to mock with more recent Java
versions. This change moves some of the necessary field access to the
dependency injection configuration so it’s restricted to a single place in the
source code and tests don’t have to mess with this.
David ‘Bombe’ Roden [Fri, 26 Aug 2022 09:57:16 +0000 (11:57 +0200)]
🔀 Merge bugfix/too-long-urls
David ‘Bombe’ Roden [Fri, 26 Aug 2022 09:55:30 +0000 (11:55 +0200)]
💚 Declare output for “writeVersion” task
David ‘Bombe’ Roden [Fri, 26 Aug 2022 09:55:16 +0000 (11:55 +0200)]
🐛 🐛 Fix too-long URLs on pages with mane unloaded elements
All the URLs were collected into a single URL for a GET requests and browsers
and servers may not like it that long.
David ‘Bombe’ Roden [Fri, 26 Aug 2022 09:52:40 +0000 (11:52 +0200)]
⬆️ Upgrade to Kotlin 1.7
And fix a bug while doing this!
David ‘Bombe’ Roden [Sun, 24 Jul 2022 12:22:46 +0000 (14:22 +0200)]
👷 Update Gradle to 7.5
David ‘Bombe’ Roden [Sat, 23 Jul 2022 21:57:33 +0000 (23:57 +0200)]
✅ Fix tests failing with non-English locales
For most of the tests it was sufficient to use the OverrideLocale TestRule added in the previous commit but in one case the creation of a date formatter needed to be delayed so that it uses the update locale during the test.
David ‘Bombe’ Roden [Sat, 23 Jul 2022 21:24:13 +0000 (23:24 +0200)]
✅ Add JUnit Rule to override locales during tests
Some tests fail when run with a non-English locale. This was found by debbiedub (see https://github.com/Bombe/Sone/pull/23) but their proposed solution was not quite to my liking.
This TestRule will store the JVM’s current default locale and set a custom locale before running a test. After the test the previous locale will be restored, in order not to mess up any other tests.
David ‘Bombe’ Roden [Sat, 16 Apr 2022 11:51:11 +0000 (13:51 +0200)]
👷 Remove FindBugs plugin
It cannot handle Kotlin and it will not be getting any upgrades. It also
prevents me from updating Gradle so it has to go. It will probably be replaced
by detekt once Gradle has been updated.
David ‘Bombe’ Roden [Sat, 16 Apr 2022 11:45:52 +0000 (13:45 +0200)]
✅ Fix failing memory database test
The test failed because of timing issues with the rate limiter when saving post
replies. The first part of the fix is to inject the rate limiter in the
constructor. The second part would be to create a special rate limiter that
only ever lets the first request pass and not the second one but for now a rate
limit of 1 element per 1000 seconds should be enough, even for the slowest
tests… unless it isn’t.
There are other rate limiters in the memory database which can cause other
tests to fail at random times in the future. Those will be left as an exercise
for another day.
David ‘Bombe’ Roden [Mon, 27 Sep 2021 14:48:03 +0000 (16:48 +0200)]
Fix test names that cause problems on Windows
I think I already complained about nobody ever compiling Sone on Windows
before, didn't I? Yes, I think I did.
David ‘Bombe’ Roden [Mon, 27 Sep 2021 14:08:29 +0000 (16:08 +0200)]
Improve names of startup-related tests
Because honestly, what does "new config" even mean? Nobody knows unless
they also know the implementation (which ties a boolean value to an
annotation named "NewConfig") so stating clearly in which scenarios the
tests are running is preferrable. Like, by A LOT.
David ‘Bombe’ Roden [Mon, 27 Sep 2021 13:24:10 +0000 (15:24 +0200)]
Update Kotlin to latest 1.4
Somehow JetBrains keeps releasing new versions of Kotlin whenever I take
a step back for a week (or a year :D) so I have to keep updating this.
David ‘Bombe’ Roden [Mon, 27 Sep 2021 12:34:26 +0000 (14:34 +0200)]
Fix incorrect comparison
The result of Object.equals(Object) will _always_ be non-null because a
primitive is always non-null. So once we use the correct method to check
the result of the equals call everything will be fine.
David ‘Bombe’ Roden [Mon, 27 Sep 2021 12:34:03 +0000 (14:34 +0200)]
Replace image implementation test with Kotlin version
David ‘Bombe’ Roden [Mon, 27 Sep 2021 11:30:44 +0000 (13:30 +0200)]
Merge branch 'update/java-11-lts' into next
David ‘Bombe’ Roden [Mon, 27 Sep 2021 11:03:39 +0000 (13:03 +0200)]
Make test work with Java 8, too
Because the Files.writeString method was only added in Java 11 but I
still want Sone to be compilable and runnable with Java 8 because
a) it's what I still use (yes, I'm proper ashamed) and b) it's probably
what many other people still use as long as Freenet doesn't bundle its
own Java (which it really should).
David ‘Bombe’ Roden [Mon, 27 Sep 2021 09:36:28 +0000 (11:36 +0200)]
Fix test so it runs on Windows, too
This also means that nobody ever tried to compile Sone on Windows. I
mean, I know that _I_ didn't do it but seeing that apparently nobody
else in the whole wide world has done it kinda makes me sad. Anyway,
it's a simple fix.
David ‘Bombe’ Roden [Mon, 27 Sep 2021 09:36:15 +0000 (11:36 +0200)]
Fix ambiguous import for Module
And this is the reason why everybody should be using single-class
imports and star imports should be avoided. The Module class (or
interface?) was added in Java 9 because of the whole module business and
now the star imports are suddenly ambiguous. Lesson learned!
David ‘Bombe’ Roden [Sun, 6 Jun 2021 09:13:13 +0000 (11:13 +0200)]
🐛 Restore ability to change languages on-the-fly
Hieronymus (sone://-wFZ6ezwU3QgvM1u8~uiLbtjxSQ19tuqn4Q94lvTrwE) noticed that
changing the language in Fred’s web interface didn’t change Sone’s language
anymore.
Part of my (ongoing) restructuring of Sone’s source code is abstracting away
all the parts that are hard to test, i.e. every interaction with Freenet
itself and the translation mechanisms are a part of that. So when I introduced
a Translation object I completely forgot that it’s possible to change the
language during runtime.
Luckily that is easily solvable using a Supplier instead of the concrete
BaseL10n object. In theory that does have a performance impact (because now
there are at least two more function calls involved per translation) but I am
quite confident that the additional time actually used by this is far below
the 1-ms range so I am not worried about it.
David ‘Bombe’ Roden [Sun, 18 Oct 2020 13:21:45 +0000 (15:21 +0200)]
🔥 Remove unused method from identity loader
David ‘Bombe’ Roden [Wed, 19 Aug 2020 17:19:42 +0000 (19:19 +0200)]
💄 Try to undo Fred’s CSS mess
David ‘Bombe’ Roden [Sat, 8 Aug 2020 20:30:18 +0000 (22:30 +0200)]
🚚 Move shells closer to the interfaces
David ‘Bombe’ Roden [Thu, 6 Aug 2020 20:03:35 +0000 (22:03 +0200)]
🎨 Store shells instead of full posts in in-memory database
David ‘Bombe’ Roden [Thu, 6 Aug 2020 18:57:08 +0000 (20:57 +0200)]
🎨 Replace test post builder with Kotlin version
David ‘Bombe’ Roden [Thu, 6 Aug 2020 18:28:46 +0000 (20:28 +0200)]
🎨 Replace in-memory post with Kotlin version
David ‘Bombe’ Roden [Thu, 6 Aug 2020 11:59:02 +0000 (13:59 +0200)]
🌐 Mention that WoT takes time to create identities
David ‘Bombe’ Roden [Wed, 5 Aug 2020 20:28:15 +0000 (22:28 +0200)]
🎨 Specify types of locks explicitely
David ‘Bombe’ Roden [Wed, 5 Aug 2020 20:22:51 +0000 (22:22 +0200)]
⚡️ Use shell to store reply data
David ‘Bombe’ Roden [Wed, 5 Aug 2020 20:04:51 +0000 (22:04 +0200)]
🎨 Replace in-memory post reply with Kotlin version
David ‘Bombe’ Roden [Wed, 29 Jul 2020 22:12:13 +0000 (00:12 +0200)]
🐛 Fix NPE during Sone removal
David ‘Bombe’ Roden [Mon, 27 Jul 2020 22:34:49 +0000 (00:34 +0200)]
✅ Rewrite test to not use mocks
David ‘Bombe’ Roden [Mon, 27 Jul 2020 20:34:42 +0000 (22:34 +0200)]
✅ Use dummy WOT connector for identity loader test
David ‘Bombe’ Roden [Mon, 27 Jul 2020 20:14:13 +0000 (22:14 +0200)]
✅ Rewrite test without using mocks
David ‘Bombe’ Roden [Thu, 2 Jul 2020 17:09:04 +0000 (19:09 +0200)]
🎨 Remove template context factory from web interface API
David ‘Bombe’ Roden [Wed, 1 Jul 2020 20:13:57 +0000 (22:13 +0200)]
🚚 Move new elements mock to test objects
David ‘Bombe’ Roden [Wed, 1 Jul 2020 20:10:48 +0000 (22:10 +0200)]
🔥 Remove methods from web interface
David ‘Bombe’ Roden [Wed, 1 Jul 2020 20:07:15 +0000 (22:07 +0200)]
🎨 Use new elements container in AJAX pages
David ‘Bombe’ Roden [Wed, 1 Jul 2020 19:22:03 +0000 (21:22 +0200)]
🎨 Add container for new posts/replies
David ‘Bombe’ Roden [Wed, 1 Jul 2020 16:57:17 +0000 (18:57 +0200)]
🚚 Rename test for list notification filter
David ‘Bombe’ Roden [Wed, 1 Jul 2020 16:56:14 +0000 (18:56 +0200)]
♻️ Extract interface for list notification filter
David ‘Bombe’ Roden [Sun, 28 Jun 2020 22:11:37 +0000 (00:11 +0200)]
🚚 Rename test to match name of tested class
David ‘Bombe’ Roden [Sun, 28 Jun 2020 22:11:12 +0000 (00:11 +0200)]
🎨 Clean up imports
David ‘Bombe’ Roden [Sun, 28 Jun 2020 22:10:43 +0000 (00:10 +0200)]
🎨 Replace list notification filter with Kotlin version
David ‘Bombe’ Roden [Sun, 28 Jun 2020 19:51:19 +0000 (21:51 +0200)]
🎨 Use Kotlin arrow type instead of Predicate
David ‘Bombe’ Roden [Sun, 28 Jun 2020 19:23:24 +0000 (21:23 +0200)]
♻️ Replace reply visibility filter interface with Kotlin version
David ‘Bombe’ Roden [Sun, 28 Jun 2020 19:11:20 +0000 (21:11 +0200)]
♻️ Supply default implementation for predicate
David ‘Bombe’ Roden [Sat, 27 Jun 2020 21:12:45 +0000 (23:12 +0200)]
♻️ Extract interface for reply visibility filter
David ‘Bombe’ Roden [Sat, 27 Jun 2020 20:49:55 +0000 (22:49 +0200)]
🎨 Rewrite test to not use mocks
David ‘Bombe’ Roden [Sat, 27 Jun 2020 20:48:51 +0000 (22:48 +0200)]
♻️ Move some code to package’s Testing.kt
David ‘Bombe’ Roden [Tue, 23 Jun 2020 04:31:52 +0000 (06:31 +0200)]
🎨 Replace reply visibility filter with Kotlin version
David ‘Bombe’ Roden [Sat, 20 Jun 2020 18:49:59 +0000 (20:49 +0200)]
♻️ Move predicate method into interface
David ‘Bombe’ Roden [Sat, 20 Jun 2020 18:30:25 +0000 (20:30 +0200)]
♻️ Extract interface from post visibility filter
David ‘Bombe’ Roden [Sat, 20 Jun 2020 12:48:22 +0000 (14:48 +0200)]
🎨 Use Java’s Predicate in reply visibility filter
David ‘Bombe’ Roden [Sat, 20 Jun 2020 12:41:17 +0000 (14:41 +0200)]
🎨 Use Java’s Predicate in post visibility filter
David ‘Bombe’ Roden [Sat, 20 Jun 2020 12:16:36 +0000 (14:16 +0200)]
🎨 Replace list notification filter test with Kotlin version
David ‘Bombe’ Roden [Sat, 20 Jun 2020 09:29:18 +0000 (11:29 +0200)]
🎨 Rename method to create replies for tests
David ‘Bombe’ Roden [Thu, 18 Jun 2020 21:18:37 +0000 (23:18 +0200)]
♻️ Rewrite test to avoid mocks
David ‘Bombe’ Roden [Thu, 18 Jun 2020 21:17:52 +0000 (23:17 +0200)]
🚚 Move test identity creation to Mocks.kt
David ‘Bombe’ Roden [Thu, 18 Jun 2020 21:15:49 +0000 (23:15 +0200)]
⬆️ Upgrade Kotlin version
David ‘Bombe’ Roden [Thu, 18 Jun 2020 17:37:02 +0000 (19:37 +0200)]
🎨 Replace test for PostVisibilityFilter with Kotlin version
David ‘Bombe’ Roden [Wed, 17 Jun 2020 17:47:28 +0000 (19:47 +0200)]
🐛 Fix breaking parser on invalid SSK/USKs
David ‘Bombe’ Roden [Tue, 26 May 2020 16:53:12 +0000 (18:53 +0200)]
🎨 Clean up imports
David ‘Bombe’ Roden [Tue, 26 May 2020 16:51:59 +0000 (18:51 +0200)]
🎨 Specify types for mocks explicitely
David ‘Bombe’ Roden [Tue, 5 May 2020 20:39:07 +0000 (22:39 +0200)]
🐛 Merge loaded identites to have all trust values
David ‘Bombe’ Roden [Fri, 1 May 2020 14:01:40 +0000 (16:01 +0200)]
♻️ Refactor parts of identity removal
David ‘Bombe’ Roden [Fri, 1 May 2020 12:51:23 +0000 (14:51 +0200)]
⚗ Use a multimap to keep track of registered USKs
David ‘Bombe’ Roden [Thu, 30 Apr 2020 12:51:31 +0000 (14:51 +0200)]
🔊 Add debug logging for unregistering USKs
David ‘Bombe’ Roden [Wed, 29 Apr 2020 12:39:50 +0000 (14:39 +0200)]
🔊 Use java.util logger instead of custom logger
David ‘Bombe’ Roden [Tue, 28 Apr 2020 08:51:49 +0000 (10:51 +0200)]
🔀 Merge tag 'v82' into next
Version 82:
* Add stricter WoT filtering.
* Add 🇮🇹 translation (thanks, Costantino Beretta!).
David ‘Bombe’ Roden [Tue, 28 Apr 2020 08:44:24 +0000 (10:44 +0200)]
🔀 Merge branch 'release/v82'
David ‘Bombe’ Roden [Tue, 28 Apr 2020 08:43:57 +0000 (10:43 +0200)]
🔖 Update Sone version
David ‘Bombe’ Roden [Tue, 28 Apr 2020 08:43:22 +0000 (10:43 +0200)]
⬆️ Update homepage edition
David ‘Bombe’ Roden [Sun, 19 Apr 2020 13:57:00 +0000 (15:57 +0200)]
🇮🇹 Add Italian translation
David ‘Bombe’ Roden [Sun, 19 Apr 2020 13:56:33 +0000 (15:56 +0200)]
🌐 Update translations
David ‘Bombe’ Roden [Sun, 19 Apr 2020 13:34:12 +0000 (15:34 +0200)]
💄 Move “Save” button back to bottom of page
David ‘Bombe’ Roden [Sat, 18 Apr 2020 22:20:42 +0000 (00:20 +0200)]
✨ Apply strict filtering when getting identities
David ‘Bombe’ Roden [Sat, 18 Apr 2020 22:11:25 +0000 (00:11 +0200)]
✨ Add option for “strict filtering” to options page
David ‘Bombe’ Roden [Sat, 18 Apr 2020 21:55:05 +0000 (23:55 +0200)]
🚧 Add processing of strict-filtering option
David ‘Bombe’ Roden [Sat, 18 Apr 2020 21:49:46 +0000 (23:49 +0200)]
🚧 Add strict filtering to preferences loader
David ‘Bombe’ Roden [Sat, 18 Apr 2020 21:47:52 +0000 (23:47 +0200)]
🚧 Add option for “strict filtering”
David ‘Bombe’ Roden [Sat, 18 Apr 2020 21:32:12 +0000 (23:32 +0200)]
✅ Use real event bus in test
David ‘Bombe’ Roden [Sat, 18 Apr 2020 15:13:18 +0000 (17:13 +0200)]
🚧 Use strictly-filtered identities
David ‘Bombe’ Roden [Sat, 18 Apr 2020 14:46:49 +0000 (16:46 +0200)]
🚧 Load ALL identities instead of only trusted ones
David ‘Bombe’ Roden [Sat, 18 Apr 2020 14:33:44 +0000 (16:33 +0200)]
🚚 Rename method to better reflect purpose
David ‘Bombe’ Roden [Sat, 18 Apr 2020 14:14:41 +0000 (16:14 +0200)]
🚧 Try to only allow identities that have no or positive trust
David ‘Bombe’ Roden [Fri, 17 Apr 2020 23:29:40 +0000 (01:29 +0200)]
🚧 Disregard identities that don’t trust anyone
David ‘Bombe’ Roden [Fri, 17 Apr 2020 18:14:36 +0000 (20:14 +0200)]
🔊 Log how much trust-all would reduce identity amount
David ‘Bombe’ Roden [Thu, 9 Apr 2020 17:10:02 +0000 (19:10 +0200)]
♻️ Slightly improve messy expression