• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

u-wave / core / 12018248150

25 Nov 2024 08:27PM UTC coverage: 81.786% (-0.2%) from 81.949%
12018248150

Pull #667

github

goto-bus-stop
Remove remnants of replace booth

This was probably a nice idea we had back when üWave was first started.
A moderator would be able to instantly put a user in the booth, skipping
the waitlist.

In practice we never implemented it, and it would require client-side
support. I doubt it's all that useful and it is just dead code right
now.
Pull Request #667: Remove remnants of replace booth

826 of 998 branches covered (82.77%)

Branch coverage included in aggregate %.

9057 of 11086 relevant lines covered (81.7%)

85.68 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

65.38
/src/controllers/waitlist.js
1
import toItemResponse from '../utils/toItemResponse.js';
1✔
2
import toListResponse from '../utils/toListResponse.js';
1✔
3

1✔
4
/**
1✔
5
 * @typedef {import('../schema.js').UserID} UserID
1✔
6
 */
1✔
7

1✔
8
/**
1✔
9
 * @type {import('../types.js').Controller}
1✔
10
 */
1✔
11
async function getWaitlist(req) {
2✔
12
  const { waitlist } = req.uwave;
2✔
13

2✔
14
  const list = await waitlist.getUserIDs();
2✔
15

2✔
16
  return toListResponse(list, { url: req.fullUrl });
2✔
17
}
2✔
18

1✔
19
/**
1✔
20
 * @typedef {object} AddToWaitlistBody
1✔
21
 * @prop {UserID} userID
1✔
22
 */
1✔
23

1✔
24
/**
1✔
25
 * POST waitlist/ entry point: used both for joining the waitlist, and for
1✔
26
 * adding someone else to the waitlist.
1✔
27
 *
1✔
28
 * @type {import('../types.js').AuthenticatedController<{}, {}, AddToWaitlistBody>}
1✔
29
 */
1✔
30
async function addToWaitlist(req) {
11✔
31
  const { user: moderator } = req;
11✔
32
  const { userID } = req.body;
11✔
33
  const { waitlist } = req.uwave;
11✔
34

11✔
35
  await waitlist.addUser(userID, { moderator });
11✔
36

7✔
37
  const updated = await waitlist.getUserIDs();
7✔
38

7✔
39
  return toListResponse(updated, { url: req.fullUrl });
7✔
40
}
11✔
41

1✔
42
/**
1✔
43
 * @typedef {object} MoveWaitlistBody
1✔
44
 * @prop {UserID} userID
1✔
45
 * @prop {number} position
1✔
46
 */
1✔
47

1✔
48
/**
1✔
49
 * @type {import('../types.js').AuthenticatedController<{}, {}, MoveWaitlistBody>}
1✔
50
 */
1✔
51
async function moveWaitlist(req) {
×
52
  const { user: moderator } = req;
×
53
  const { userID, position } = req.body;
×
54
  const { waitlist } = req.uwave;
×
55

×
56
  await waitlist.moveUser(userID, position, { moderator });
×
57

×
58
  const updated = await waitlist.getUserIDs();
×
59

×
60
  return toListResponse(updated, { url: req.fullUrl });
×
61
}
×
62

1✔
63
/**
1✔
64
 * @typedef {object} RemoveFromWaitlistParams
1✔
65
 * @prop {UserID} id
1✔
66
 */
1✔
67

1✔
68
/**
1✔
69
 * @type {import('../types.js').AuthenticatedController<RemoveFromWaitlistParams>}
1✔
70
 */
1✔
71
async function removeFromWaitlist(req) {
×
72
  const { user: moderator } = req;
×
73
  const { id: userID } = req.params;
×
74
  const { waitlist } = req.uwave;
×
75

×
76
  await waitlist.removeUser(userID, { moderator });
×
77

×
78
  const updated = await waitlist.getUserIDs();
×
79

×
80
  return toListResponse(updated, { url: req.fullUrl });
×
81
}
×
82

1✔
83
/**
1✔
84
 * @type {import('../types.js').AuthenticatedController}
1✔
85
 */
1✔
86
async function clearWaitlist(req) {
×
87
  const { user: moderator } = req;
×
88
  const { waitlist } = req.uwave;
×
89

×
90
  await waitlist.clear({ moderator });
×
91

×
92
  const updated = await waitlist.getUserIDs();
×
93

×
94
  return toListResponse(updated, { url: req.fullUrl });
×
95
}
×
96

1✔
97
/**
1✔
98
 * @typedef {object} LockWaitlistBody
1✔
99
 * @prop {boolean} lock
1✔
100
 */
1✔
101

1✔
102
/**
1✔
103
 * @type {import('../types.js').AuthenticatedController<{}, {}, LockWaitlistBody>}
1✔
104
 */
1✔
105
async function lockWaitlist(req) {
×
106
  const { user: moderator } = req;
×
107
  const { lock } = req.body;
×
108
  const { waitlist } = req.uwave;
×
109

×
110
  if (lock) {
×
111
    await waitlist.lock({ moderator });
×
112
  } else {
×
113
    await waitlist.unlock({ moderator });
×
114
  }
×
115

×
116
  return toItemResponse({ locked: lock }, { url: req.fullUrl });
×
117
}
×
118

1✔
119
export {
1✔
120
  getWaitlist,
1✔
121
  addToWaitlist,
1✔
122
  moveWaitlist,
1✔
123
  removeFromWaitlist,
1✔
124
  clearWaitlist,
1✔
125
  lockWaitlist,
1✔
126
};
1✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc