2 Tests (the wirst one was caught by you, I describe it nevertheless because the user experience could be improved) with the second one I was however able to withdraw more funds than I had on your side: 

1st test: 

So I had a balance of 40 Satoshi. My first test was to widthdraw 41 Satoshi using this invoice:

lnbc410n1pdcztffpp5e5cysufsraxxfsk7d97vl7kxpk7jy9cn5rkypv5c7quffrtpn9ysdp5wa5kgargv3exzae3wdshgmmndp5k6mmjv46xsctwvfskcctwvdjscqp287lzpgjlns92q8lhwe7h80gcqc9u5s22k9s0p4p4p727lyqnqtexftcmrjl9knqek003md08p603mqgzf3p3e8j44y3974fn3er0qasq3d83t6

This did not work. However I did not receive any error message. In case people make a typo this is bad. I suggest once people enter an invoice you decode the invoice and show them how many satoshi they are about to withdraw and what their balance will be afterwards. and ask them then to confirm the widthdraw process (as long as the invoice is smaller than their balance)

Aftwerwards I widthdrew 38 satoshi with the following invoice

lnbc380n1pdcztt9pp5g0gc9dt9wmtj99690ztvvwv8havgf4urd95mh9vqgkaq4ulwjcmqdp5wa5kgargv3exzaejwdshgmmndp5kcetnwd6xsctwvfskcctwvdjscqp2rkfdjlruedwzjphqzcmptnr922x0swmmp427kaa4t4za9q2x4qyk2jmvkqdl4kl207hpj8zrlgttw0s23sczn25vhlhwhuhswsf6qxcqs66qgj


(Worked like a charm) leaving me a balance of 2 satoshi.

2nd test:

starting with a blance of 2 staoshi I created two invoices

this:

lnbc20n1pdczt0kpp5jcsg0g3l9pvnwlcr2kw6krgkwe4j4r6wjcy2v4cadmj93zjwlhlqdp0wa5kgargv3exzaejwdshgmmndp5kxmmwvd6hyun9de6xc7gcqp2vedmp0hqflxrjggx9axaghulkgss4z9klcvmgvg059xncce8pf6z39228ef6vz487scxwwy4gaadenq9wey4qemg2u3st5fr6whztucpqheq49


and that: 

lnbc20n1pdcztsppp5umren35wmx247tq3khxp9zx7s95g7g05c3ludv0glegm84rwl3qsdp0wa5kgargv3exzaejwdshgmmndp5kxmmwvd6hyun9de6xc7gcqp295z9323k8mshp7a47r38eq8ys330549sqdphxecv09d78n4z02yjru0t2q7gfxnut8xtlx6vwlty4xlqe0p4zkh773kq8feskg9mg3cp5nkwwm


For your reference both invoices have the same description widthdraw2satoshiconcurrently


I opened the withdraw dialog in two windows. I added the first invoice to the first dialog and the second one to the other one. Now I quickly pressed both widthdraw buttons. I was able to withdraw 4 satoshi even though my balance was only 2 satoshi. 


I guess after clicking the button you check the balance and if it is fine you initiate a payment with lightning (which of course takes some time) in this time I could pass your check if sufficient funds were there with the second request to withdraw funds. 


There are many fixes to this and should be implemented before the site starts to grow (: You have to take care to not create deadlocks however.


also the rest of your application logic seems to work fine (c.f. this screenshot) Though I expected my balance to be -2 statoshi which also did not happen. 



If you give me an invoice I will send you back the two satoshis!


It is the first application that I tested but I guess there will be more lightning applications running into similar problems. So if you agree on this I would use this example (in particular with your website) in an educational video about how to handle concurrent payment requests.