Code RoomCollaborators fetch silently fails
MediumPrep Room Coding #1777

Collaborators fetch silently fails

Code reviewCode quality & reviewMid–Senior~22 min

Review this Java endpoint that fetches a document and its collaborators.

What a strong answer looks like

Separate real bugs from style. Rank issues by severity, point at the root cause rather than the symptom, and suggest a concrete fix, specific and kind.

0:00 of about 22 min
Mark a line and say what kind of problem it is.0 findings
1@GetMapping("/docs/{id}")
2public Map<String, Object> getDoc(@PathVariable String id) {
3 Document doc = repo.findById(id).orElse(null);
4 Map<String, Object> resp = new HashMap<>();
5 resp.put("id", doc.getId());
6 resp.put("title", doc.getTitle());
7 try {
8 resp.put("collaborators", collabService.fetch(id));
9 } catch (Exception e) {
10 // best effort
11 }
12 return resp;
13}
Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.