-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SubscribeInvoices, can't get settle_index 1 #2469
Comments
@ottosuess have you been able to reproduce this on your node? I think it may just be a documentation issue, as from my understanding, we send out all indexes greater than or equal to the specified index |
@cfromknecht yes, when I set |
Could we add new parameters to the API that uses greater or equal, then deprecate the old ones? |
What about treating |
@riperk I think the default value is 0, so you cannot differentiate that from not set. |
Any update on this wrinkle? New hold invoice system avoids this issue but curious to see what the cleanest fix is. |
We're planning a new sub-server RPC call to fix all the issues with the existing base service invoice subscription endpoint. Until then, the hacky way would be to use |
Yes the hack ended up not being so bad.
…On Wed, Jun 3, 2020, 8:45 PM Olaoluwa Osuntokun ***@***.***> wrote:
We're planning a new sub-server RPC call to fix all the issues with the
existing base service invoice subscription endpoint. Until then, the hacky
way would be to use LIstInvoices to just grab that first invoice (if you
really need it), then you subscription for the rest. I'd imagine an
application is storing the two indexes (settle and add) on their end so
they can resume consuming the stream after a restart.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#2469 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABMAFU4V2WQBBBT6FG3B3S3RU3VBZANCNFSM4GPZ4UAQ>
.
|
Unfortunately protobuf standard don't support generics, so we can't just define message Nothing {
}
message Maybe a {
oneof unMaybe {
a just = 1;
Nothing nothing = 2;
}
} So absence representation is not possible in general, but it's still might be done this way: The same practice can be used to represent absence of value of any custom enum type as well. These small messages-wrappers are a bit similar to |
Hi! Any change in this issue? I noticed that REST API has the same problem. Example:
Returns a collection of invoices that always have the first settle_index == 2. If the value of settle_index query param is set to 0, only new invoices will be notified. Is the workaround still been the suggested by @Roasbeef? Thank you very much in advance! |
REST is just a generic wrapper around the gRPC API, so all features (and problems) are the same. |
Many thanks for your fast reply @guggero and thanks also for your work in this project. So, I will use the workaround! |
Closing this as we'll be able to resolve it with this larger overhaul (this is tech debt): #6288 The work around is to fetch the first invoice, then subscribe for the rest |
Background
Documentation for the
SubscribeInvoices
call says about thesettle_index
:That means if I set the
settle_index
to 0 i only get notified about new Invoices.If I set the
settle_index
to 1 the first Invoice I get notified about is the one with ansettle_index
of 2.So I'm always missing the first first invoice.
Would be cool if I could just rely on
SubscribeInvoices
to get notified about all my invoices. But right now I have to use theListInvoices
call to page through all my invoices until the first invoice is settled to make this work.same for the
add_index
.Possible Solutions
settle_index
start at 2settle_index
to 0 and make the default value something else (null or -1)Your environment
The text was updated successfully, but these errors were encountered: