Coder Social home page Coder Social logo

itu-devops-h's People

Contributors

dependabot[bot] avatar erentomurcuk avatar herover avatar knittedsox avatar pizzaluc avatar smilladion avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

erentomurcuk

itu-devops-h's Issues

Fix new messages being invisible with second account

Sign up > Sign in > Post message > Sign out > Sign up > Sign in > Post message
This path messes up the user's timeline. You cannot see the messages you post with the second account, and you can see the messages of the first account on your own timeline without having followed them. Following and unfollowing other accounts also doesn't work correctly.

Separate the database layer

We need to use a different database, for example Postgres. In relation to that, we need to get rid of the direct SQL queries in our code - not very secure.

Write Short Units of Code - BetterCodeHub Issue

Given Guideline Explanation from BetterCodeHub:

  • When writing new units, don't let them grow above 15 lines of code.
  • When a unit grows beyond 15 lines of code, you need to shorten it by splitting it in smaller units of no longer than 15 lines of code.

Listing given units from highest to lowest severity:

  1. WebApplication.main() (55 LoC)
  2. control.sh:$default (45 LoC)
  3. WebApplication.register() (34 LoC)
  4. WebApplication.render() (29 LoC)
  5. control.sh:build-in-docker() (28 LoC)
  6. update_image.sh:$default (27 LoC)
  7. WebApplication.getMessages() (24 LoC)
  8. install_docker.sh:$default (21 LoC)
  9. SQLite.main() (19 LoC)

Tested code forked on 03.04.2022

Fix URLs

Add a get_url equivalent function and fix navbar links, just set models urls to WebApplication.URLS or WebApplication.URLS.class.

Memory leak in server

Something is leaking memory causing linux to kill the process after a few days, see graph
image

Can only view last 30 messages.

It is currently only possible to see the last 30 messages submitted unless you go into the individual users page to see all their previous messages. But this is not a possibility once their last message isn't loaded anymore.

Setup docker containerization

Create docker image automatically when pushing to main

Upload it automatically to some docker image hub, so the server can fetch the latest image

Add prompts for user feedback (flashes in Flask)

This issue already has a branch flashes with some work. Right now it shows a prompt after registering, but it does not go away again.

The Python version gives the user feedback in the shape of prompts that say "You were logged in", "You were logged out", "Your message was recorded", "You are now following 'user'", "You are no longer following 'user'" and "You were successfully registered and can login now".

Follow/unfollow endpoint update

For now just returns true, but needs to be updated to return correct http code, and redirect to users page like the legacy version

Fix "database is locked" error for public timeline

When logging in with an account, posting a message, and then clicking the "public timeline" link in the navbar: trying to post another message after this will produce a "database is locked" error. Has to do with a missing conn.close() statement.

Fix control.sh script

Certain commands break when running this script, such as build and build-in-docker.

Database keeps (write?) lock after creating user

@smilladion noticed that these steps will make throw errors about a locked database on creating new users

  • Create new user
  • Sign in with a user (required)
  • Sign out
  • Create a second user, following message shows in browser: org.sqlite.SQLiteException: [SQLITE_BUSY] The database file is locked (database is locked)
    In the console this will print
org.sqlite.SQLiteException: [SQLITE_BUSY]  The database file is locked (database is locked)
	at org.sqlite.core.DB.newSQLException(DB.java:1030)
	at org.sqlite.core.DB.newSQLException(DB.java:1042)
	at org.sqlite.core.DB.execute(DB.java:881)
	at org.sqlite.jdbc3.JDBC3PreparedStatement.execute(JDBC3PreparedStatement.java:54)
	at WebApplication.lambda$static$9(WebApplication.java:466)
	at spark.RouteImpl$1.handle(RouteImpl.java:72)
	at spark.http.matching.Routes.execute(Routes.java:61)
	at spark.http.matching.MatcherFilter.doFilter(MatcherFilter.java:134)
	at spark.embeddedserver.jetty.JettyHandler.doHandle(JettyHandler.java:50)
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1584)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
	at org.eclipse.jetty.server.Server.handle(Server.java:501)
	at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:383)
	at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:556)
	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:375)
	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:273)
	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)
	at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:336)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:313)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:171)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:129)
	at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:375)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:806)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:938)
	at java.base/java.lang.Thread.run(Thread.java:833)

Separate WebApplication into multiple classes

Our main class is a monster - would be nice to divide it out into some more classes, for our own sake.

For example, we could have one class for routes, one for API routes, one for util methods and so on.

We can also do an MVC structure with classes like User, Message etc.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.