Giter VIP home page Giter VIP logo

ft_transcendence's Introduction

Hi there 👋, I'm Reaster

i'm a 42Paris student

earnaud's 42 stats

i'm trying to learn how to do math at dumb rocks

Skills: C / C++ / JS / TS /PYTHON

  • 🔭 I’m currently working on my 42 Cursus github
    Top Langs

ft_transcendence's People

Contributors

ala-na avatar alkanaev avatar leschats avatar reaster0 avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

ala-na

ft_transcendence's Issues

Set default velocity to random

It'll be funnier if ball initial movements can't be predicted.

I will wait for a game interface to test it and implement it =)

Redirect user to TwoFAPage when TwoFA is enabled

After an user enabled 2FA : When user click on "login" and after he completed 42 auth, user is redirected to home page. User have to click a second time on "login" and then put the 2FA code before being considered as login.
A possible improvement would be to redirect user to the page asking for 2FA code right after 42 auth, if possible ?

Friends system

In back, user's friends ids (numbers) are stored inside an array. There's no controller function inside users.controller for adding/removing a friend right now inside back (Get/post/patch/...) but some functions are made inside users.service.ts.
For info, an user should be able to see his friends status (playing/online/offline).
In subject, this feature is listed under user's account and same in correction.
I'll add controller functions about it inside user module.

redirection after 42auth modification

the redirection of the route /api/auth/login-42 should redirect to /login and on the port 80 (not 8080) now
the page will show "you should not be there" but i will fix that later

Vuetify 3 is not a stable version

Subject say we should use "last stable version" for each framework/library used.
Vuetify 3 is only on beta. Buuut, as Vuetify 3 is more compatible with Vue 3 (which is stable), I guess we can defend that position in correction.
Honestly I don't think that anyone is going to check the version we use for library and stuff, but still, better prepare an argument before hand.

Disable 2FA

A system for disabling 2FA should be made, according to correction =/

Check subject after 29th of june

Because many students shared their 42 API keys on their public github repo, 42's staff said they will modify ft_transcendence and others concerned projects subjects on the 26th.
I guess those modifications should only concerned the API stuff and maybe a line about leaving our .env inside our git repo will be eleminatory. But further check is necessary.

Set up VPN for tests

Quick explanation: Evan got a VPN which he could set up in order for us to test on the same network once front and back are put together.

Code chat part

State : Left for later as we privilege more urgent parts
No assignees yet

2e2

Test with Jest to implement if nothing else to do or issues with some routes
Postponed for now

Obtain a more complete log for backend

Goal :

  • Find a way to have information on server side each time a request is made

Some clues :
https://docs.nestjs.com/techniques/logger
https://stackoverflow.com/questions/66617285/nestjs-in-express-mode-log-all-incoming-requests

Note : Fastify seems to be more exigent with routes, it may need to clean up our code to it's standards

If we can't find an automated way to do it, we can always make it the "dummy" way with calls to console.log() which will be displayed each time a controller is triggered.

Other option :

  • Middleware (see video 59 of official nestJs course)

issue with the /user/settings route

when i make a request to the route using patch and with a correct json body, i get the answer 200 and there's still no modification in the db, did i make a mistake or the route is not ready yet?
Capture d’écran 2022-05-23 à 12 06 35

Others users infos

An user should be able to access other users informations and stats, according to subject

clean code

Possible improvements to improve efficiency or security:

  • Except for errors and maybe important logger, clean console.log() and this.logger.log() => make our code faster
  • Check that every possible error is taken care of, for example by try/catch block

Uncaught TypeError: canvas is null

I encounter this error inside Console each time I resize my window.
Funny enough it doesn't pop when on "home page", but once I clicked on some buttons (account/game/...), it's unavoidable.

The details of the error sometimes changes, so here are some logs of it:

Uncaught TypeError: canvas is null resize CanvasComp.vue:44 resize CanvasComp.vue:44 resize self-hosted:1178 resize self-hosted:1178

Uncaught TypeError: canvas is null resize CanvasComp.vue:44 mounted CanvasComp.vue:76 callWithErrorHandling runtime-core.esm-bundler.js:155 callWithAsyncErrorHandling runtime-core.esm-bundler.js:164 __weh runtime-core.esm-bundler.js:2685 flushPostFlushCbs runtime-core.esm-bundler.js:356 flushJobs runtime-core.esm-bundler.js:401

Uncaught TypeError: canvas is null resize CanvasComp.vue:44 mounted CanvasComp.vue:76 callWithErrorHandling runtime-core.esm-bundler.js:155 callWithAsyncErrorHandling runtime-core.esm-bundler.js:164 __weh runtime-core.esm-bundler.js:2685 flushPostFlushCbs runtime-core.esm-bundler.js:356 flushJobs runtime-core.esm-bundler.js:401 promise callback*queueFlush runtime-core.esm-bundler.js:285 queueJob runtime-core.esm-bundler.js:279 effect runtime-core.esm-bundler.js:5168 triggerEffects reactivity.esm-bundler.js:382 triggerRefValue reactivity.esm-bundler.js:982 effect reactivity.esm-bundler.js:1113 triggerEffects reactivity.esm-bundler.js:382 triggerRefValue reactivity.esm-bundler.js:982 effect reactivity.esm-bundler.js:1113 triggerEffects reactivity.esm-bundler.js:382 triggerRefValue reactivity.esm-bundler.js:982 effect reactivity.esm-bundler.js:1113 triggerEffects reactivity.esm-bundler.js:382 triggerRefValue reactivity.esm-bundler.js:982 effect reactivity.esm-bundler.js:1113 triggerEffects reactivity.esm-bundler.js:382 triggerRefValue reactivity.esm-bundler.js:982 set value reactivity.esm-bundler.js:1026 finalizeNavigation vue-router.esm-bundler.js:3197 pushWithRedirect vue-router.esm-bundler.js:3070 promise callback*pushWithRedirect vue-router.esm-bundler.js:3040 push vue-router.esm-bundler.js:2969 install vue-router.esm-bundler.js:3386 use runtime-core.esm-bundler.js:3834 <anonymous> main.js:10 js app.js:184 __webpack_require__ app.js:1470 __webpack_exports__ app.js:2681 O app.js:1516 <anonymous> app.js:2682 <anonymous> app.js:2684

More info about this error (link associated with errors messages by console): https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Unexpected_type

Idk if someone was already aware of this error, but I'm making an issue of it just in case ;)

Warning when launching docker-compose

Just to keep you up to date

Front

  • Some warning about npm packages use in front (will try to download latest versions from my computer as I don't have sudo rights on 42 computers)
    npm WARN EBADENGINE Unsupported engine { npm WARN EBADENGINE package: '@achrinza/[email protected]', npm WARN EBADENGINE required: { node: '8 || 10 || 12 || 14 || 16 || 17' }, npm WARN EBADENGINE current: { node: 'v18.2.0', npm: '8.10.0' } npm WARN EBADENGINE } npm WARN deprecated [email protected]: The querystring API is considered Legacy. new code should use the URLSearchParams API instead. npm WARN deprecated [email protected]: vuetify-loader has been renamed to webpack-plugin-vuetify for Vuetify 3 npm WARN deprecated [email protected]: this library is no longer supported npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142 npm WARN deprecated [email protected]: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details. npm WARN deprecated [email protected]: core-js@<3.4 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.

  • Some warning about size of files used

`warning

asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
This can impact web performance.
Assets:
fonts/materialdesignicons-webfont.5d875350.eot (1000 KiB)
fonts/materialdesignicons-webfont.54b0f60d.woff2 (318 KiB)
fonts/materialdesignicons-webfont.d671cbf6.woff (454 KiB)
fonts/materialdesignicons-webfont.21f691f0.ttf (1000 KiB)
img/arrow-left.50d7b8ba.png (375 KiB)
img/arrow-right.28c52cca.png (374 KiB)
img/blurredy.d059c8a3.jpg (3.3 MiB)
css/chunk-vendors.05ccbf40.css (591 KiB)
js/chunk-vendors.b7d63461.js (439 KiB)

warning

entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.
Entrypoints:
app (1.11 MiB)
css/chunk-vendors.05ccbf40.css
js/chunk-vendors.b7d63461.js
css/app.d3e08c8a.css
js/app.dae8f6ed.js

File Size Gzipped

dist/js/chunk-vendors.b7d63461.js 439.12 KiB 133.54 KiB
dist/js/app.dae8f6ed.js 89.08 KiB 21.30 KiB
dist/js/webfontloader.33ec0995.js 12.03 KiB 4.84 KiB
dist/css/chunk-vendors.05ccbf40.css 591.02 KiB 84.45 KiB
dist/css/app.d3e08c8a.css 17.17 KiB 2.94 KiB
`

Back

  • npm packages warning (same as front, will try to upload latest versions)

npm WARN deprecated [email protected]: this library is no longer supported npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142 npm WARN deprecated [email protected]: This package is no longer supported. It's now a built-in Node module. If you've depended on crypto, you should switch to the one that's built-in. npm WARN deprecated @types/[email protected]: This is a stub types definition. socket.io provides its own type definitions, so you do not need this installed. npm WARN deprecated @hapi/[email protected]: Moved to 'npm install @sideway/pinpoint' npm WARN deprecated @hapi/[email protected]: Moved to 'npm install @sideway/formula' npm WARN deprecated [email protected]: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details. npm WARN deprecated @hapi/[email protected]: Moved to 'npm install @sideway/address' npm WARN deprecated @hapi/[email protected]: Switch to 'npm install joi'

  • Vulnerabilities : Will look into it, but that's probably the recent nestJS vulnerabilities (we can do nothing about it)
    12 high severity vulnerabilities

User setting edit

the editing of users setting is broken....

when changing nickname where sending bad request at each new character entry.
that eventually lead the all page to brake (here the avatar as suddenly disappear)

Screen Shot 2022-06-22 at 1 51 29 PM

Slight Auth Issue

the first time a user connect to the website using 42auth, he click once the button, authenticate, then go back to the /login page and is not registered, he need to click another time to finally be registered

i'll look for it on my side but you can check on it on your side too whenever you got the time :')

Find a way to get cookie inside websockets socket.io with httpOnly: true inside auth module

Initial problem

Cookie can't be access from socket.io websockets as client.handshake.headers['cookie'] return undefined value.
Then, user opening a websocket can't be identified.

Fix and problem

For now, the fix found is to set httpOnly: false when setting cookie with jwt token inside auth module (see auth.controller.ts file).
But as it's good pratice to set httpOnly to true, it'll be interesting to find another solution to the problem

chat blink on new message

This may be coming from the last Chat PR that enable ordering channel by update date.
but now the chat is blinking on each new message.... very disturbing.
Find solution or downgrade :(

Vue warning for vuetify elements

On chat page, warning as displayed inside console :
[Vue warn]: Failed to resolve component: v-subheader

This warning pops up for v-subheader, v-list-item-group, v-list-item-content, v-tabs-slider and v-tabs-item which are all vuetify elements. I tried to fix this, but solutions I found on the mighty internet were mostly JS compatible and not TS, or were not working.

It's only warnings and elements are correctly displayed, so I guess we can ignore them. But I still do my duty to report =)

Code game part

State : Left for later as we privilege more urgent parts
No assignees yet

Scroll of the website is broken ;w;

i realise that when i merged the branch new_chat on reaster-front in the commit 1d70354 the scrolling of the website as been locked and i can't scroll in the website anywhere now

disconnect outside game

Screen Shot 2022-06-25 at 5 40 27 PM

just after matching, but before accepting the matching (no game launched) if one wannabe player quit the lobby the other player is forceful disconnect and redirect to home page.

Access watch game from chat

According to correction, accessing a match of a player should be done from chat or friend interface.
I made the logic for it inside chat interface and started it on TheGame.vue.

@Reaster0, I put some TODO comments where the rest of the logic should be implemented. It may need some variables manipulations to have the correct display. Can you please continue it ?

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.