Commit cc058e7
authored
feat(supabase_flutter): Make
[Supabase] Make initialize() idempotent
This PR introduces a minor update to the initialize() method to avoid throwing when called multiple times. Instead, it logs an informational message and returns the existing instance, making initialization idempotent and smoother for production use.
- Replaced assert(!_instance.isInitialized) with a runtime check to prevent throwing.
- Added _log.info() when a reinitialization attempt occurs.
- Exposed isInitialized as a public read-only getter for improved observability.
- Avoids throwing errors in release mode by gracefully handling repeated initialization.Supabase.initialize() idempotent (#1194)1 parent fb58bcd commit cc058e7
1 file changed
+12
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
| 45 | + | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
94 | 95 | | |
95 | 96 | | |
96 | 97 | | |
| |||
152 | 153 | | |
153 | 154 | | |
154 | 155 | | |
155 | | - | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
156 | 160 | | |
157 | 161 | | |
158 | 162 | | |
| |||
177 | 181 | | |
178 | 182 | | |
179 | 183 | | |
180 | | - | |
| 184 | + | |
181 | 185 | | |
182 | 186 | | |
183 | 187 | | |
| |||
214 | 218 | | |
215 | 219 | | |
216 | 220 | | |
217 | | - | |
| 221 | + | |
218 | 222 | | |
219 | 223 | | |
220 | 224 | | |
| |||
0 commit comments