Jump to content

Alin

Members
  • Content Count

    8
  • Joined

  • Last visited

Everything posted by Alin

  1. Since Delphi 12.2 or so, many of my FMX TStringGrids in an application act erratically. Tonight I managed to isolate and reproduce such a bug, on Delphi 12.3 and Delphi 13 (didn't try earlier versions), and on Windows 11 Pro (licensed, updated, no mods). It's a very short program, with almost no code, so I strongly believe the bug is in Delphi and not my fault. It contains three TStringGrids and if you scroll (with scroll bar or mouse wheel) to the bottom of the TVertScrollBox which contains them, one of the TStringGrids always starts increasing the widhts of its first four columns by +3, indefinitely, and quite fast. Also, in certain conditions, quickly rolling the mouse wheel to scroll downwards and rapidly moving over one of those StringGrids will generate the same effect (columns start to increase in width and if you don't click anywhere they will increase indefinitely, sometimes in two or three TSGs at the same time). And if you hide the first TSG, then the third one does not increase the column withds if you scroll down with the scroll bar but it does if you scroll down with the mouse wheel (if you did not scroll down with the bar first). Truly strange behavior and I can reproduce it 100% of the time. Has .anyone. encountered this kind of weird problem (TSG increasing its column withds)? The program is small but the form has a specific setup (layouts and a vertscrollbox) so I don't know how to post it. Perhaps I can as a zip file, if anybody wants to have some fun with such a bug? If that simple layout is not in that simple setup (three non-visual elements aligned to Client), I could not replicate the problem (to always take place). And I need that specific layout, as this example I built is actually a completely stripped-down version of my real app.
  2. Thank you! I will submit it, because I can't find any way around the bug. The alignments are part of a larger and more complex interface, and I would need to reconfigure most of it to avoid those alignments, plus to add a lot of events. And maybe all that will not help as the bug could still surface even then.
  3. So the bug is visible in your context, too, thank you for your confirmation, it is very valuable for me. As for the pruning: of course that if you cut out much of the code and alignment, there is no bug 🙂 You can prune the app to become a completely empty app, and it will (most likely) never behave unexpectedly, but I believe that is not the point here. The problem is that under certain circumstances, the bug is visible, and in my case, in the original app, it simply renders it unusable. You wrote: "I don't understand why you use panel and 2 layouts... and the OnShow alignments" As I wrote in my first message, this is an already very pruned "app" (99.99% of its content is already removed). The app is actually around 20,000 lines, and I deleted almost everything in order to reveal the bug but leave things simple. I need those alignments for many, many reasons and many, many components (and many other StringGrids in it, having all the same problem as these ones here) which I deleted in around 6 straight hours in order to be able to obtain a simple app which still exposes the bug. And it is becoming more and more clear to me that it is a Delphi bug, because no matter how I play with the alignments, this should never happen. It happens with Delphi 12 and 13, and Windows 10 and 11.
  4. I apologize, I am not used to using this kind of plaform and wasn't sure how to proceed. I have now attached the full source code (it's tiny) of the so-called application. Please compile and run it, and I hope it will behave the same for you, too. If not, I will find a way to post a short video of its behavior. I have tested it on W10 and W11, it works the same. There is a label within the form with the "instructions" on how to trigger the bug (I believe it's a Delphi bug, because I have no action code there). Thank you! StringGrid FMX strange 1.zip
  5. First I want to .honestly. congratulate and thank Dave Nottage and all his collaborators for the great work which is the Kastri Library. I would praise it more but I don't want to annoy the other readers. And now for the question itself 🙂 I have succeded in programatically using Kastri and PushIt example parts to send a single message (a.k.a. notification) through Firebase Cloud Messaging System, to a single recipient, using a single token. I have seen that Google's SDK can multicast a message to up to 500 recipients - for example if I want to send the same message simultaneously to many users who have nothing in common, thus without relying on topics, groups and so on, which are not appropriate for my use case scenario. I want to somehow feed FCM a list of 500 tokens so it could send the message to all of them. How can this be done in Delphi? How should one implement this? Is it a different request / JSON syntax? Or is it done by simply sending 500 separate messages, each to a single recipient? And if it can only be done using a succession of single-recipient messages, how many FCMSenders can I set up to use on a single FCM service account? I need short quick bursts from time to time. The example I want to expand to multiple tokens/recipients is something like this (below is the JSON content from the memo of the PushIt example, I deleted some CRLFs): {"message":{ "token":"c1bF8qRZfB2i_9FgWtLsX4DVWvDMMb6EOHKAfNdOxt-LubU9by-akksT5uVEKzuGpKJrSrGmOOK0ypBrBc9m.....", "notification":{ "title":"Title1", "body":"Body1" }, "apns":{ "payload":{ "aps":{ "badge":0, "mutable-content":1 } } } } } I apologize if this question has already been asked, I wasn't able to find the thread. Thank you again! Alin
  6. Thank you! So I will have to resort to the brute force approach. In the future I think I will have to handle at least 50 messages / second with peaks of 100 up to 200 messages / second (sometimes they are time-critical), which I am thinking to send using multiple threads and possibly multiple FireBase service accounts. I think I will almost need a separate machine to do all this - if the project expands. I don't know which limits are set by Google for those who send messages through this method, I may have some (unpleasant) surprises in the future. Thank you again for all your help and your libraries!
  7. Thank you very much for replying! I now understand the matter with the topics, thank you! I have studied the groups (via the link you posted) and I think I have found that: 1. they have at most 20 members (perhaps they are only targeted for groups of devices belonging to the same user / person) " The maximum number of members allowed for a notification key is 20. " 2. they are accessible only through the old (legacy) HTTP protocol, which is severely discouraged or even disabled for new projects " You can use device group messaging via the legacy XMPP or HTTP protocols on your app server. " In this case: creating a group, sending the message and then deleting the group could be only marginally more effective than the brute force approach of sending single-device messages. Did I understand this correctly? Have a nice day! Alin
  8. Thank you very much for answering! I will try to give some more details about my issue. I have around 100,000 (not paying) users in this app and I need to be able to send notifications to some of them at any moment, for example 1,500 now and 2,000 in an hour. These two (1.5k and 2k) recipient sets are completely random, they have nothing in common except for a coincindence when 4 users may be the same in both sets; they are not subscribed to anything and I must be able to pick any number of random users and send a notification to each of them. I could create groups or topics but those groups/topics would mean nothing after the notification messages are sent, as the next batch could be just as random as the previous one. Grouping them in any consistent way is impossible and any group or topic should dissolve after I sent a certain batch to that group, since the next set will not be based on any former group. And the most difficult part is that I don't get to pick those recipients - but a special kind of app users do, and they have no fixed criteria for this (they are administrators of certain things and I have to let them do their thing; the users sometimes wait for those notifications and even worse, sometimes they need them in case of some emergency; this is not an app for fun). I wish to do it like sending a newsletter for example: if I own/control the database then I can pick at any given time 2,500 random recipients and send the e-mail or the snail-mail to them if necessary, depending on criteria that can be anything. But those administrators above decide, and they don't group users into groups or topics, it's about very different criteria. How can I do the same for these FCM notifications? What is the best solution in this case, what would you recommend me to do? My fall-back-to scenario is the brute force approach, where I would create a few servers to send these messages one by one, through a few FCM service accounts. This is quite blunt and I hope there is a more refined possibility. I was hoping for some "group message" constructed in JSON, with more than one recipient in the token list. Or could I create a topic and subscribe the users to it from the server side, then send the message to that topic, and then dissolve it? Thank you, Alin
×