Skip to content
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

Handle telegram messages without fetcher #99

Conversation

rohitsangwan01
Copy link
Contributor

This Pr adds capability to handle updates from telegram with our custom implementations

for example, from cloud functions , we cannot start longPolling or a webhook listener
so there we can only listen to cloud function's entry point method
so only option left is to get json data from that entry method and pass that into this library to handle it

and that's where this new api : handleUpdate(Update) is useful , so we can simply pass the update from this method instead of starting any fetcher

Also this Pr changed dart min sdk version to : 2.17.7 because that cloud function am talking about does not support upper dart sdk for now ( probably in future soon ), and for same reason also changed version of http library
Which i guess no harm for now, because http latest version uses Dart3 which makes it incompatible with older dart sdk's

@HeySreelal
Copy link
Owner

Hey, thanks for raising this. That's indeed a different thought process to solve even bigger problems. I'm grateful that you opened this pull request.

My only concern is regarding the downgrading of the SDK constraints and the version of the http package.

Are these downgrades necessary, or can we proceed with the current versions? I was actually planning to migrate to Dart 3 in the very near future.

@rohitsangwan01
Copy link
Contributor Author

rohitsangwan01 commented Jun 4, 2023

@HeySreelal yes for my current use case , am stuck with dart older version, because that cloud function only support older dart sdk, I guess keeping older version is no harm for now
Because am sure many other people also haven't updated their project to Dart3 yet
And with time that cloud function will also update its Dart version,
I can use my own fork, but it would become harder to keep fork updated, if you add dart3 specific features

@HeySreelal
Copy link
Owner

I'm still kind of confused. This is actually a good feature to be added, but degrading the versions doesn't sounds good to me. Maybe I'll ask around the team and get back to you very soon.
CC: @busslina @deargosep @GiuseppeFn

--
Btw, Are you by any chance using the @GoogleCloudPlatform/functions-framework-dart for writing cloud functions with Dart?

This one seems to support Dart 3 and http:v1 on the dev channel.

@rohitsangwan01
Copy link
Contributor Author

@HeySreelal am using appwrite cloud functions,
https://appwrite.io/docs/functions
Max Dart version they support is 2.17
Ok we can do this
Instead of Dart 2.18 we can use dart 2.17 for dart sdk constraints
And keep http to latest
I will override that in my project

@HeySreelal
Copy link
Owner

Hey, yeah yeah, that'd probably work. Thanks again :)

@HeySreelal HeySreelal changed the base branch from main to dev June 6, 2023 03:06
@HeySreelal HeySreelal merged commit 5c2fc74 into HeySreelal:dev Jun 6, 2023
1 of 2 checks passed
@HeySreelal
Copy link
Owner

Hey, just to update you. I've added that minor change and merged this with Televerse. Soon to be published to the pub.dev.

Thanks again for opening this PR.

Feel free to jump into our discussion on our Telegram Group

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants