Giter VIP home page Giter VIP logo

cercet's People

Contributors

leon-de avatar nycodeghg avatar paul2708 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

cercet's Issues

Update student editor on view click

If the teacher clicks on "View", the current editor of the student is shown.
However, if the student is not typing anything, the editor shows the default template.

To avoid this, it requires an "initial request" that will be broadcasted to the student.
The student replies with his current editor content.

List of teachers

At the moment, the name of the teachers are hard-coded in source code.
They should be extracted to a separate file that is read at runtime.

Server cannot find default config

I added a config file that got mounted:

- "./config.yaml:/app/config.yaml"

If the config exists, everything works fine.

If the config doesn't exist, the following error occurs when using Docker:

backend_1   | java.io.FileNotFoundException: ./config.yaml (Is a directory)
backend_1   |   at java.base/java.io.FileInputStream.open0(Native Method)
backend_1   |   at java.base/java.io.FileInputStream.open(FileInputStream.java:219)
backend_1   |   at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157)
backend_1   |   at de.paul2708.server.config.Configuration.load(Configuration.java:30)
backend_1   |   at de.paul2708.server.JavalinServer.configureAndStart(JavalinServer.java:59)
backend_1   |   at de.paul2708.server.Main.main(Main.java:7)

See Configuration.load.
If I run the jar locally, everything works fine.

Code execution

Code shouldn't be compiled and executed on the real machine.
A container would be a better solution for this.

Should there be a container for each compilation?

Output limit

If you run a while (true) loop, the code execution will be terminated after a certain timeout.
However, if the code contains output like

while (true) {
  System.out.println("spam");
}

the output will be buffered and sent to the student although the process is already termianted.

A simple fix would be to count each output in OutputObserver and ignore further messages.

Docker image

There should be a docker image that runs server and website.

Frontend Rewrite

The current frontend code is absolutely unmaintainable and should get a hole rewrite. I think angular is way to overkill for this project. I thought to rewrite it either with Vue, Svelte, or React.

The current frontend is working for the mvp, but implementing more features is very difficult to impossible.

NPE

The following error occurs multiple times:

backend_1   | [Connector-Scheduler-7ea9e1e2-1] WARN io.javalin.Javalin - Uncaught exception in WebSocket handler
backend_1   | java.lang.NullPointerException
backend_1   |   at de.paul2708.server.user.User.hasSameSocket(User.java:33)
backend_1   |   at de.paul2708.server.user.UserRegistry.lambda$findUser$0(UserRegistry.java:27)
backend_1   |   at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:176)
backend_1   |   at java.base/java.util.HashMap$ValueSpliterator.tryAdvance(HashMap.java:1696)
backend_1   |   at java.base/java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:127)
backend_1   |   at java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:502)
backend_1   |   at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:488)
backend_1   |   at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
backend_1   |   at java.base/java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:150)
backend_1   |   at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
backend_1   |   at java.base/java.util.stream.ReferencePipeline.findAny(ReferencePipeline.java:548)
backend_1   |   at de.paul2708.server.user.UserRegistry.findUser(UserRegistry.java:28)
backend_1   |   at de.paul2708.server.ws.event.CloseListener.handle(CloseListener.java:25)
backend_1   |   at io.javalin.websocket.WsHandlerController$onClose$1.invoke(WsHandlerController.kt:56)
backend_1   |   at io.javalin.websocket.WsHandlerController$onClose$1.invoke(WsHandlerController.kt:24)
backend_1   |   at io.javalin.websocket.WsHandlerController.tryBeforeAndEndpointHandlers(WsHandlerController.kt:74)
backend_1   |   at io.javalin.websocket.WsHandlerController.onClose(WsHandlerController.kt:56)
backend_1   |   at jdk.internal.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
backend_1   |   at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
backend_1   |   at java.base/java.lang.reflect.Method.invoke(Method.java:566)
backend_1   |   at org.eclipse.jetty.websocket.common.events.annotated.CallableMethod.call(CallableMethod.java:70)
backend_1   |   at org.eclipse.jetty.websocket.common.events.annotated.OptionalSessionCallableMethod.call(OptionalSessionCallableMethod.java:68)
backend_1   |   at org.eclipse.jetty.websocket.common.events.JettyAnnotatedEventDriver.onClose(JettyAnnotatedEventDriver.java:146)
backend_1   |   at org.eclipse.jetty.websocket.common.WebSocketSession.callApplicationOnClose(WebSocketSession.java:393)
backend_1   |   at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.close(AbstractWebSocketConnection.java:225)
backend_1   |   at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.onReadTimeout(AbstractWebSocketConnection.java:564)
backend_1   |   at org.eclipse.jetty.io.AbstractConnection.onFillInterestedFailed(AbstractConnection.java:172)
backend_1   |   at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.onFillInterestedFailed(AbstractWebSocketConnection.java:539)
backend_1   |   at org.eclipse.jetty.io.AbstractConnection$ReadCallback.failed(AbstractConnection.java:317)
backend_1   |   at org.eclipse.jetty.io.FillInterest.onFail(FillInterest.java:140)
backend_1   |   at org.eclipse.jetty.io.AbstractEndPoint.onIdleExpired(AbstractEndPoint.java:407)
backend_1   |   at org.eclipse.jetty.io.IdleTimeout.checkIdleTimeout(IdleTimeout.java:171)
backend_1   |   at org.eclipse.jetty.io.IdleTimeout.idleCheck(IdleTimeout.java:113)
backend_1   |   at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
backend_1   |   at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
backend_1   |   at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
backend_1   |   at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
backend_1   |   at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
backend_1   |   at java.base/java.lang.Thread.run(Thread.java:834)

Timeout after 5 minutes

After 5 minutes, a timeout occurs if the socket didn't read or write.
There are two possibilities to avoid this:

  1. The client sends a heartbeat message every minute that follows the message format.
  2. Increase the timeout from 5 minutes to 90 minutes since a tutorial lasts 90 minutes.

I would prefer (1) if it's possible.

Close student editor when disconnecting

Given a teacher that views a student.
If the student disconnects, the teacher view updates and removes the student from the list.
However, the editor of the student is still open. This leads to exceptions if the teacher sends cursor updates.

So next to the list update, the editor should disappear.

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.