Problem
In my app, I start two different subscriptions with two different queries at the start of the app (i.e., one listens for messages and one listens for notifications). Doing so for some reason throws the following error
{extensions: {path: $, code: start-failed}, message: an operation already exists with this id: "...... the id/key ...... " }
HasuraRequestError: an operation already exists with this id: "....... the id/key (same as above) ......"
A simple code to reproduce:
void main() async {
final url = '.....';
final headers = {......};
final query1 = 'subscription messages { .......... }';
final query2 = 'subscription notifications { ...... }';
final hasuraClient = HasuraConnect(url, headers: headers);
(await hasuraClient.subscription(query1)).listen((event) {});
(await hasuraClient.subscription(query2)).listen((event) {});
}
(In my app, I have them in separate places but they pretty much start at the same time)
a workaround:
adding some delay before one of the subscriptions makes solve the problem but it's not optimal (I found 300ms to be a good delay, anything lower will throw the error).
Problem
In my app, I start two different subscriptions with two different queries at the start of the app (i.e., one listens for messages and one listens for notifications). Doing so for some reason throws the following error
{extensions: {path: $, code: start-failed}, message: an operation already exists with this id: "...... the id/key ...... " } HasuraRequestError: an operation already exists with this id: "....... the id/key (same as above) ......"A simple code to reproduce:
(In my app, I have them in separate places but they pretty much start at the same time)
a workaround:
adding some delay before one of the subscriptions makes solve the problem but it's not optimal (I found 300ms to be a good delay, anything lower will throw the error).