-
Notifications
You must be signed in to change notification settings - Fork 379
fix: eliminate unread indicator flicker and scroll jumps on push notification entry #2506
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
Open
Castropy
wants to merge
1
commit into
GetStream:master
Choose a base branch
from
Castropy:bug/new_messages
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+222
−17
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
packages/stream_chat/example/ios/Flutter/ephemeral/flutter_lldb_helper.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| # | ||
| # Generated file, do not edit. | ||
| # | ||
|
|
||
| import lldb | ||
|
|
||
| def handle_new_rx_page(frame: lldb.SBFrame, bp_loc, extra_args, intern_dict): | ||
| """Intercept NOTIFY_DEBUGGER_ABOUT_RX_PAGES and touch the pages.""" | ||
| base = frame.register["x0"].GetValueAsAddress() | ||
| page_len = frame.register["x1"].GetValueAsUnsigned() | ||
|
|
||
| # Note: NOTIFY_DEBUGGER_ABOUT_RX_PAGES will check contents of the | ||
| # first page to see if handled it correctly. This makes diagnosing | ||
| # misconfiguration (e.g. missing breakpoint) easier. | ||
| data = bytearray(page_len) | ||
| data[0:8] = b'IHELPED!' | ||
|
|
||
| error = lldb.SBError() | ||
| frame.GetThread().GetProcess().WriteMemory(base, data, error) | ||
| if not error.Success(): | ||
| print(f'Failed to write into {base}[+{page_len}]', error) | ||
| return | ||
|
|
||
| def __lldb_init_module(debugger: lldb.SBDebugger, _): | ||
| target = debugger.GetDummyTarget() | ||
| # Caveat: must use BreakpointCreateByRegEx here and not | ||
| # BreakpointCreateByName. For some reasons callback function does not | ||
| # get carried over from dummy target for the later. | ||
| bp = target.BreakpointCreateByRegex("^NOTIFY_DEBUGGER_ABOUT_RX_PAGES$") | ||
| bp.SetScriptCallbackFunction('{}.handle_new_rx_page'.format(__name__)) | ||
| bp.SetAutoContinue(True) | ||
| print("-- LLDB integration loaded --") |
5 changes: 5 additions & 0 deletions
5
packages/stream_chat/example/ios/Flutter/ephemeral/flutter_lldbinit
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # | ||
| # Generated file, do not edit. | ||
| # | ||
|
|
||
| command script import --relative-to-command-file flutter_lldb_helper.py |
32 changes: 32 additions & 0 deletions
32
packages/stream_chat_flutter/example/ios/Flutter/ephemeral/flutter_lldb_helper.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| # | ||
| # Generated file, do not edit. | ||
| # | ||
|
|
||
| import lldb | ||
|
|
||
| def handle_new_rx_page(frame: lldb.SBFrame, bp_loc, extra_args, intern_dict): | ||
| """Intercept NOTIFY_DEBUGGER_ABOUT_RX_PAGES and touch the pages.""" | ||
| base = frame.register["x0"].GetValueAsAddress() | ||
| page_len = frame.register["x1"].GetValueAsUnsigned() | ||
|
|
||
| # Note: NOTIFY_DEBUGGER_ABOUT_RX_PAGES will check contents of the | ||
| # first page to see if handled it correctly. This makes diagnosing | ||
| # misconfiguration (e.g. missing breakpoint) easier. | ||
| data = bytearray(page_len) | ||
| data[0:8] = b'IHELPED!' | ||
|
|
||
| error = lldb.SBError() | ||
| frame.GetThread().GetProcess().WriteMemory(base, data, error) | ||
| if not error.Success(): | ||
| print(f'Failed to write into {base}[+{page_len}]', error) | ||
| return | ||
|
|
||
| def __lldb_init_module(debugger: lldb.SBDebugger, _): | ||
| target = debugger.GetDummyTarget() | ||
| # Caveat: must use BreakpointCreateByRegEx here and not | ||
| # BreakpointCreateByName. For some reasons callback function does not | ||
| # get carried over from dummy target for the later. | ||
| bp = target.BreakpointCreateByRegex("^NOTIFY_DEBUGGER_ABOUT_RX_PAGES$") | ||
| bp.SetScriptCallbackFunction('{}.handle_new_rx_page'.format(__name__)) | ||
| bp.SetAutoContinue(True) | ||
| print("-- LLDB integration loaded --") |
5 changes: 5 additions & 0 deletions
5
packages/stream_chat_flutter/example/ios/Flutter/ephemeral/flutter_lldbinit
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # | ||
| # Generated file, do not edit. | ||
| # | ||
|
|
||
| command script import --relative-to-command-file flutter_lldb_helper.py |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
packages/stream_chat_flutter_core/example/ios/Flutter/ephemeral/flutter_lldb_helper.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| # | ||
| # Generated file, do not edit. | ||
| # | ||
|
|
||
| import lldb | ||
|
|
||
| def handle_new_rx_page(frame: lldb.SBFrame, bp_loc, extra_args, intern_dict): | ||
| """Intercept NOTIFY_DEBUGGER_ABOUT_RX_PAGES and touch the pages.""" | ||
| base = frame.register["x0"].GetValueAsAddress() | ||
| page_len = frame.register["x1"].GetValueAsUnsigned() | ||
|
|
||
| # Note: NOTIFY_DEBUGGER_ABOUT_RX_PAGES will check contents of the | ||
| # first page to see if handled it correctly. This makes diagnosing | ||
| # misconfiguration (e.g. missing breakpoint) easier. | ||
| data = bytearray(page_len) | ||
| data[0:8] = b'IHELPED!' | ||
|
|
||
| error = lldb.SBError() | ||
| frame.GetThread().GetProcess().WriteMemory(base, data, error) | ||
| if not error.Success(): | ||
| print(f'Failed to write into {base}[+{page_len}]', error) | ||
| return | ||
|
|
||
| def __lldb_init_module(debugger: lldb.SBDebugger, _): | ||
| target = debugger.GetDummyTarget() | ||
| # Caveat: must use BreakpointCreateByRegEx here and not | ||
| # BreakpointCreateByName. For some reasons callback function does not | ||
| # get carried over from dummy target for the later. | ||
| bp = target.BreakpointCreateByRegex("^NOTIFY_DEBUGGER_ABOUT_RX_PAGES$") | ||
| bp.SetScriptCallbackFunction('{}.handle_new_rx_page'.format(__name__)) | ||
| bp.SetAutoContinue(True) | ||
| print("-- LLDB integration loaded --") |
5 changes: 5 additions & 0 deletions
5
packages/stream_chat_flutter_core/example/ios/Flutter/ephemeral/flutter_lldbinit
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # | ||
| # Generated file, do not edit. | ||
| # | ||
|
|
||
| command script import --relative-to-command-file flutter_lldb_helper.py |
32 changes: 32 additions & 0 deletions
32
packages/stream_chat_persistence/example/ios/Flutter/ephemeral/flutter_lldb_helper.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| # | ||
| # Generated file, do not edit. | ||
| # | ||
|
|
||
| import lldb | ||
|
|
||
| def handle_new_rx_page(frame: lldb.SBFrame, bp_loc, extra_args, intern_dict): | ||
| """Intercept NOTIFY_DEBUGGER_ABOUT_RX_PAGES and touch the pages.""" | ||
| base = frame.register["x0"].GetValueAsAddress() | ||
| page_len = frame.register["x1"].GetValueAsUnsigned() | ||
|
|
||
| # Note: NOTIFY_DEBUGGER_ABOUT_RX_PAGES will check contents of the | ||
| # first page to see if handled it correctly. This makes diagnosing | ||
| # misconfiguration (e.g. missing breakpoint) easier. | ||
| data = bytearray(page_len) | ||
| data[0:8] = b'IHELPED!' | ||
|
|
||
| error = lldb.SBError() | ||
| frame.GetThread().GetProcess().WriteMemory(base, data, error) | ||
| if not error.Success(): | ||
| print(f'Failed to write into {base}[+{page_len}]', error) | ||
| return | ||
|
|
||
| def __lldb_init_module(debugger: lldb.SBDebugger, _): | ||
| target = debugger.GetDummyTarget() | ||
| # Caveat: must use BreakpointCreateByRegEx here and not | ||
| # BreakpointCreateByName. For some reasons callback function does not | ||
| # get carried over from dummy target for the later. | ||
| bp = target.BreakpointCreateByRegex("^NOTIFY_DEBUGGER_ABOUT_RX_PAGES$") | ||
| bp.SetScriptCallbackFunction('{}.handle_new_rx_page'.format(__name__)) | ||
| bp.SetAutoContinue(True) | ||
| print("-- LLDB integration loaded --") | ||
5 changes: 5 additions & 0 deletions
5
packages/stream_chat_persistence/example/ios/Flutter/ephemeral/flutter_lldbinit
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # | ||
| # Generated file, do not edit. | ||
| # | ||
|
|
||
| command script import --relative-to-command-file flutter_lldb_helper.py |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| # | ||
| # Generated file, do not edit. | ||
| # | ||
|
|
||
| import lldb | ||
|
|
||
| def handle_new_rx_page(frame: lldb.SBFrame, bp_loc, extra_args, intern_dict): | ||
| """Intercept NOTIFY_DEBUGGER_ABOUT_RX_PAGES and touch the pages.""" | ||
| base = frame.register["x0"].GetValueAsAddress() | ||
| page_len = frame.register["x1"].GetValueAsUnsigned() | ||
|
|
||
| # Note: NOTIFY_DEBUGGER_ABOUT_RX_PAGES will check contents of the | ||
| # first page to see if handled it correctly. This makes diagnosing | ||
| # misconfiguration (e.g. missing breakpoint) easier. | ||
| data = bytearray(page_len) | ||
| data[0:8] = b'IHELPED!' | ||
|
|
||
| error = lldb.SBError() | ||
| frame.GetThread().GetProcess().WriteMemory(base, data, error) | ||
| if not error.Success(): | ||
| print(f'Failed to write into {base}[+{page_len}]', error) | ||
| return | ||
|
|
||
| def __lldb_init_module(debugger: lldb.SBDebugger, _): | ||
| target = debugger.GetDummyTarget() | ||
| # Caveat: must use BreakpointCreateByRegEx here and not | ||
| # BreakpointCreateByName. For some reasons callback function does not | ||
| # get carried over from dummy target for the later. | ||
| bp = target.BreakpointCreateByRegex("^NOTIFY_DEBUGGER_ABOUT_RX_PAGES$") | ||
| bp.SetScriptCallbackFunction('{}.handle_new_rx_page'.format(__name__)) | ||
| bp.SetAutoContinue(True) | ||
| print("-- LLDB integration loaded --") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # | ||
| # Generated file, do not edit. | ||
| # | ||
|
|
||
| command script import --relative-to-command-file flutter_lldb_helper.py |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: GetStream/stream-chat-flutter
Length of output: 101
🏁 Script executed:
Repository: GetStream/stream-chat-flutter
Length of output: 467
🏁 Script executed:
Repository: GetStream/stream-chat-flutter
Length of output: 55
🏁 Script executed:
# Read the Ruff configuration cat /home/jailuser/git/ruff.tomlRepository: GetStream/stream-chat-flutter
Length of output: 979
🏁 Script executed:
Repository: GetStream/stream-chat-flutter
Length of output: 99
🏁 Script executed:
# Read the actual file to verify unused arguments cat -n ./packages/stream_chat_persistence/example/ios/Flutter/ephemeral/flutter_lldb_helper.pyRepository: GetStream/stream-chat-flutter
Length of output: 1572
🏁 Script executed:
Repository: GetStream/stream-chat-flutter
Length of output: 152
🏁 Script executed:
Repository: GetStream/stream-chat-flutter
Length of output: 672
🏁 Script executed:
Repository: GetStream/stream-chat-flutter
Length of output: 209
🏁 Script executed:
Repository: GetStream/stream-chat-flutter
Length of output: 88
🏁 Script executed:
Repository: GetStream/stream-chat-flutter
Length of output: 160
Add iOS ephemeral directory to
.gitignoreor configure Ruff per-file-ignore.The file header states "Generated file, do not edit," so modifying it is not sustainable. Ruff will flag
bp_loc,extra_args, andintern_dictas unused (ARG001), but these parameters are required by the LLDB callback protocol signature.The proper fix is to either:
**/ios/Flutter/ephemeralto.gitignore(consistent with how macos, windows, and linux ephemeral directories are already ignored), ORruff.toml:Do not modify the generated file directly.
🧰 Tools
🪛 Ruff (0.14.14)
[warning] 7-7: Unused function argument:
bp_loc(ARG001)
[warning] 7-7: Unused function argument:
extra_args(ARG001)
[warning] 7-7: Unused function argument:
intern_dict(ARG001)
🤖 Prompt for AI Agents