Commit 5c321b2
fix(livetennisapi): address review — clamp limit, guard malformed payloads, dark-mode icon, more tests
- Clamp the limit input to the API's documented 1-200 range before the
request instead of forwarding out-of-range values.
- Validate decoded 200 payloads (object with a 'data' list / score object)
so malformed responses surface as friendly error rows instead of
AttributeError/TypeError escaping the component.
- Icon: complete the isDark contract — index.tsx reads the dark store and
passes isDark; the SVG uses it for the tile color and omits it from the
DOM spread (Valkey pattern).
- Tests: player-search API-error, fixtures non-timeout HTTP error,
malformed-payload and limit-clamp cases for each component; docstrings.
The free-tier quota text (30 requests/minute, 100/day) is correct per the
API's OpenAPI description — 1,000/day is the BASIC tier — so it is
deliberately unchanged.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>1 parent d917ecf commit 5c321b2
10 files changed
Lines changed: 201 additions & 20 deletions
File tree
- src
- backend/tests/unit/components/bundles/livetennisapi
- bundles/lfx-bundles/src/lfx_bundles/livetennisapi
- frontend/src/icons/LiveTennisAPI
Lines changed: 34 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
Lines changed: 19 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
Lines changed: 35 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
85 | 86 | | |
86 | 87 | | |
87 | 88 | | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
Lines changed: 29 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
11 | 26 | | |
12 | 27 | | |
13 | 28 | | |
| |||
37 | 52 | | |
38 | 53 | | |
39 | 54 | | |
40 | | - | |
| 55 | + | |
41 | 56 | | |
42 | 57 | | |
43 | 58 | | |
| |||
47 | 62 | | |
48 | 63 | | |
49 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
50 | 73 | | |
| 74 | + | |
51 | 75 | | |
52 | | - | |
| 76 | + | |
53 | 77 | | |
54 | 78 | | |
55 | 79 | | |
| |||
60 | 84 | | |
61 | 85 | | |
62 | 86 | | |
63 | | - | |
64 | 87 | | |
65 | 88 | | |
66 | | - | |
| 89 | + | |
67 | 90 | | |
68 | 91 | | |
69 | 92 | | |
| |||
91 | 114 | | |
92 | 115 | | |
93 | 116 | | |
94 | | - | |
| 117 | + | |
95 | 118 | | |
96 | 119 | | |
97 | 120 | | |
| |||
100 | 123 | | |
101 | 124 | | |
102 | 125 | | |
| 126 | + | |
103 | 127 | | |
104 | 128 | | |
Lines changed: 30 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
12 | 27 | | |
13 | 28 | | |
14 | 29 | | |
| |||
53 | 68 | | |
54 | 69 | | |
55 | 70 | | |
56 | | - | |
| 71 | + | |
57 | 72 | | |
58 | 73 | | |
59 | 74 | | |
| |||
63 | 78 | | |
64 | 79 | | |
65 | 80 | | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
66 | 89 | | |
| 90 | + | |
67 | 91 | | |
68 | 92 | | |
69 | 93 | | |
| |||
102 | 126 | | |
103 | 127 | | |
104 | 128 | | |
| 129 | + | |
105 | 130 | | |
106 | | - | |
| 131 | + | |
107 | 132 | | |
108 | 133 | | |
109 | 134 | | |
| |||
114 | 139 | | |
115 | 140 | | |
116 | 141 | | |
117 | | - | |
118 | 142 | | |
119 | 143 | | |
120 | | - | |
| 144 | + | |
121 | 145 | | |
122 | 146 | | |
123 | 147 | | |
| |||
131 | 155 | | |
132 | 156 | | |
133 | 157 | | |
134 | | - | |
| 158 | + | |
135 | 159 | | |
136 | 160 | | |
137 | 161 | | |
| |||
140 | 164 | | |
141 | 165 | | |
142 | 166 | | |
| 167 | + | |
143 | 168 | | |
144 | 169 | | |
Lines changed: 11 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
14 | 22 | | |
15 | 23 | | |
16 | 24 | | |
| |||
42 | 50 | | |
43 | 51 | | |
44 | 52 | | |
| 53 | + | |
45 | 54 | | |
46 | 55 | | |
47 | 56 | | |
| |||
56 | 65 | | |
57 | 66 | | |
58 | 67 | | |
59 | | - | |
| 68 | + | |
60 | 69 | | |
61 | 70 | | |
62 | 71 | | |
| |||
83 | 92 | | |
84 | 93 | | |
85 | 94 | | |
86 | | - | |
| 95 | + | |
87 | 96 | | |
88 | 97 | | |
89 | 98 | | |
| |||
0 commit comments