Skip to content

Commit

Permalink
update notes given the fixes in bun v1.1.14
Browse files Browse the repository at this point in the history
  • Loading branch information
Bannerets committed Jun 24, 2024
1 parent d5d08f7 commit e227e62
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
none of those have been received in the last 10 (`receiveTimeout`) seconds.
- In bun, fixed the old tdjson interface exiting the process instantly.

Update: this is related to bun < v1.1.14 only.

## [email protected] (2024-05-28)

- The compatibility with `tdl-tdlib-addon` is removed. The `Client` constructor
Expand Down
6 changes: 3 additions & 3 deletions packages/tdl/addon/td.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class ReceiveWorker {
{
if (client == nullptr) // New tdjson interface
thread.detach();
tsfn.Ref(env); // bun does not ref by default
tsfn.Ref(env); // note: bun (<v1.1.14) does not ref by default
}
~ReceiveWorker() {
{
Expand Down Expand Up @@ -129,8 +129,8 @@ class ReceiveWorker {
// on execute() and receive(). Since we never call execute() in this
// thread, it should be safe not to copy the response here.
lock.lock();
// bun doesn't call the callback if data is nullptr, so pass an empty
// string instead
// note: bun (<v1.1.14) doesn't call the callback if the data is nullptr
// passing an empty string if response is null
char *data = const_cast<char *>(response == nullptr ? empty_str : response);
tsfn.NonBlockingCall(data);
}
Expand Down

0 comments on commit e227e62

Please sign in to comment.