Skip to content

Reducing tech debt #28

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Sep 4, 2023
Merged

Reducing tech debt #28

merged 6 commits into from
Sep 4, 2023

Conversation

shaygeko
Copy link
Contributor

@shaygeko shaygeko commented Sep 4, 2023

  • Resolve dependency issue with firestore
  • Refactor Updates Collecting code: split into dedicated services per platform, more comments
  • Switch form username to mongoid in updates collection to prevent weird bugs when a user switches username in the middle of updates collection
  • Imported testing libraries
  • Added tests for VjudgeUpdatesCollection

Closes #27

- using mongoid instead of username in vjudge and leetcode updates collection
- split vjudge and leetcode logic into dedicated services, added an interface that both implement
- removed a legacy endpoint
if(response.status === 404) throw new UserNameNotFoundError(username, "vjudge");
else throw new ExternalApiError("vjudge", response.status);
try {
const response = await axios.get(`https://vjudge.net/user/solveDetail/${username}`);

Check failure

Code scanning / CodeQL

Server-side request forgery

The [URL](1) of this request depends on a [user-provided value](2).
throw error;
return response.data.data.matchedUser;
} catch (error) {
console.error(`Error fetching data for user ID ${userId}:`, error);

Check failure

Code scanning / CodeQL

Use of externally-controlled format string

Format string depends on a [user-provided value](1). Format string depends on a [user-provided value](2).
Copy link
Contributor

@dannyl1u dannyl1u left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

@shaygeko shaygeko merged commit f20ce1b into main Sep 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Decide on testing and assertion libraries for backend
2 participants