Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ linter:
- avoid_returning_this
- avoid_void_async
- directives_ordering
- discarded_futures
- library_private_types_in_public_api
- omit_local_variable_types
- parameter_assignments
- prefer_asserts_with_message
Expand All @@ -51,6 +53,5 @@ linter:
# - avoid_catches_without_on_clauses (sometimes catching all exceptions is intentional)
# - avoid_dynamic_calls (necessary when working with JSON/dynamic data)
# - cascade_invocations (not always clearer)
# - discarded_futures (fire-and-forget is sometimes intentional)
# - lines_longer_than_80_chars (too restrictive for modern screens)
# - prefer_expression_function_bodies (block bodies can be clearer)
4 changes: 2 additions & 2 deletions example/basic/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ final isProduction = defineBoolean(
),
);

void main(List<String> args) {
fireUp(args, (firebase) {
void main(List<String> args) async {
await fireUp(args, (firebase) {
// ==========================================================================
// HTTPS Callable Functions (onCall / onCallWithData)
// ==========================================================================
Expand Down
4 changes: 2 additions & 2 deletions example/firestore_test/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'package:firebase_functions/firebase_functions.dart';

void main(List<String> args) {
fireUp(args, (firebase) {
void main(List<String> args) async {
await fireUp(args, (firebase) {
// Test Firestore onDocumentCreated with wildcard
firebase.firestore.onDocumentCreated(document: 'users/{userId}', (
event,
Expand Down
4 changes: 2 additions & 2 deletions example/with_options/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import 'package:firebase_functions/firebase_functions.dart';

/// Comprehensive example testing ALL HTTP function options.
/// This validates that the builder correctly extracts and exports all 21 options.
void main(List<String> args) {
fireUp(args, (firebase) {
void main(List<String> args) async {
await fireUp(args, (firebase) async {
// Test 1: HTTPS onRequest with ALL GlobalOptions + cors
firebase.https.onRequest(
name: 'httpsFull',
Expand Down
4 changes: 2 additions & 2 deletions lib/src/https/callable.dart
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ class CallableResponse<T extends Object> {

_streamSubscription = dataStream.listen(
(result) {
sendChunk(result.data);
unawaited(sendChunk(result.data));
},
onError: (Object error) {
// Log error but don't close the stream - let handler complete
Expand Down Expand Up @@ -297,7 +297,7 @@ class CallableResponse<T extends Object> {
/// Marks the stream as aborted.
void abort() {
_aborted = true;
_streamSubscription?.cancel();
unawaited(_streamSubscription?.cancel());
_streamSubscription = null;
clearHeartbeat();
}
Expand Down
4 changes: 2 additions & 2 deletions test/unit/https_callable_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ void main() {
expect(response.streamingResponse!.headers['Connection'], 'keep-alive');

// Cleanup
response.closeStream();
unawaited(response.closeStream());
});

test('sendChunk returns false when not streaming', () async {
Expand Down Expand Up @@ -339,7 +339,7 @@ void main() {
// Just verify it doesn't throw
response.clearHeartbeat();

response.closeStream();
unawaited(response.closeStream());
});

test('stream method forwards stream data', () async {
Expand Down
Loading