Skip to content

Instantly share code, notes, and snippets.

View eingress's full-sized avatar

Eingress Ltd eingress

View GitHub Profile
@eingress
eingress / hasura_connect_ex.dart
Created March 4, 2024 09:38 — forked from osaxma/hasura_connect_ex.dart
a workaround for keeping haura_connect subscriptions alive when using JWT
import 'dart:async';
import 'package:meta/meta.dart';
import 'package:hasura_connect/hasura_connect.dart';
import 'package:http/http.dart' as http;
// problem:
// when subscribing to`HasuraConnect.subscription`, a websocket connection is created on the first subscription
// call. The websocket connection is created only once with the initial subscription and the provided TokenInterceptor
// or headers. When the token expires during an active subscription, HasuraConnect doesn't stop the subscription, or try
// to reconnect with the latest token in in the TokenInterceptor nor does it throw an error. It'll keep calling `onRequest`
@eingress
eingress / launch.json
Last active December 16, 2022 11:17
VSCode Flutter launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "Android Phone",
"request": "launch",
"type": "dart",
"deviceId": "Device Name"
},
{