Problem: I've been worried about merging these version bump pull
requests since we don't have many tests, and I *really* don't want to
merge any catostrophic breaking changes anywhere.
Solution: Add some tests that are more comprehensive, starting by
creating a temporary SSB database and keypair and then editing the
profile, previewing a message, publishing a message, etc., until we have
a handful of small functions actually being tested. This won't ensure
that everything works forever, and it *really* doesn't test replication,
but it should help increase our confidence that test success means that
fewer things are broken.
Problem: I thought it would be a good idea to keep our SSB stack in
another module but it just creates friction and adds another layer to
our stack that has to be independently upgraded and versioned.
Solution: Merge the @fraction/flotilla source code into Oasis so that we
don't have to maintain two separate projects.
Problem: Recently there was a PR [0] merged with a quickfix to avoid
some test failures, which is something I've been trying to avoid. While
`process.exit()` works fine, I'm worried that it means we don't
understand what's happening under the hood, *plus* I have the [maybe
unjustified?] worry that it might kill the process during a database
write or something dangerous. It looks like this particular test hang
was caused by both a stream and some number of intervals that were left
open.
Solution: Provide a way to close the stream and intervals in `index.js`
and ensure that we do that before closing the server.
[0]: https://github.com/fraction/oasis/pull/462
after having restored the package-lock.json to that of the master branch, this
PR now uses common-good@2.0.3, which has common-good check as a command.
i ran it manually as $(npm bin)/common-good check, and fixed whatever
it complained about.
Problem: The auto-stage code was a horrible hack that may be causeing an
OOM bug if too many peers are staged too quickly.
Solution: Since SSB-CONN now supports a variable number of connection
hops, we can remove the auto-stage hack and use the default scheduler
instead of trying to staple on our own hacky scheduler fix.
Problem: The Windows tests seem to be failing, it looks like a timeout
problem? Also there are a handful of debug statements around the code
that can be safely removed.
Solution: Double the timeout length and remove debug statements.
Problem: The test suite isn't closing the database because `app.close()`
only affects the HTTP server. This means that tests don't exit cleanly
and sockets remain open and all sorts of really fun stuff that we don't
want while writing tests.
Solution: Refactor `src/ssb.js` so that we can exit cleanly and have
less rope to hang ourselves with. Add a small lifecycle test that can
help us ensure that the bare minimum lifecycle events are working
correctly, plus now the previous tests are passing on my machine too.
Problem: ESLint and TypeScript help catch some types of regressions, but
they don't protect us against obvious stuff like "the server won't
start". This means that humans need to test a bunch of stuff manually,
and that can be really tedious and exhausting.
Solution: Yesterday someone invented this cool concept called "testing"
where you write automated tests for your software to ensure it actually
works the way you expect. It might have beeen invented before yesterday,
I don't know. Anyway, this solution adds a bunch of tests that send HTTP
GET requests to a bunch of endpoints to make sure the server is at least
returning HTTP 200 responses. It also fixes a race condition where HTTP
server was available before the readme / version strings were loaded.
Problem: Our dependencies are getting ahead of us!
Solution: Catch up with `npm update`. I think Markdown-It was the only
breaking change, and it didn't affect us.
Problem: Project root has a handful of files that aren't used at all or
could be placed elsewhere.
Solution: Delete unused files and move the changelog to the
documentation directory with the other Markdown files (other than the
readme, of course).
Problem: The workaround is no longer necessary now that the new version
of @types/koa has been published. Thanks to @peterblazejewicz,
@harryparkdotio, and @orta for the quick upstream fix.
Solution: Run `npm update` and remove the `@ts-ignore` comment.
Problem: Some sigil links were broken because of a bug in SSB-Markdown
that was recently resolved.
Solution: Upgrade SSB-Markdown.
Fixes: https://github.com/fraction/oasis/issues/242
Problem: We have TypeScript enabled on the project but have been missing
lots of definition files, so there are like 500 errors when you enable
`--noImplicitAny`.
Solution: Add definitions and fix the bugs that they point out. This
reduces the number of errors with `--noImplicitAny` to 285.
Problem: Our dependencies are falling behind and it'd be nice to have
them up-to-date. The only big update it that Common-Good upgraded to the
latest version of Prettier.
Solution: Update them!